Skip to content

Commit 045d7af

Browse files
committed
chore: v0.1.9-beta.0
2 parents f30cacf + 6dcdef7 commit 045d7af

File tree

6 files changed

+32
-17
lines changed

6 files changed

+32
-17
lines changed

CHANGELOG.md

+18-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
## v0.1.8-beta.0
21

3-
- Add `show` prop to `Popup`, that allows you to specify whether the popup should be shown or hidden.
2+
## v0.1.9
3+
4+
- Added `"use client"` banner to build outputs
5+
6+
## v0.1.8
7+
8+
- Added `token` and `tokenFetcher` props to [Session](https://talkjs.com/docs/Reference/React_Native_SDK/Components/Session/). For more details on how to use JSON Web Token (JWT)-based authentication, see the [authentication documentation](https://talkjs.com/docs/Features/Security_Settings/Authentication/).
9+
- Deprecated the `signature` prop on the [Session](https://talkjs.com/docs/Reference/React_Native_SDK/Components/Session/) component. Signature-based authentication continues to be supported indefinitely, but JWT-based authentication is recommended for new projects.
10+
11+
## v0.1.7
12+
13+
- Added `show` prop to `Popup`, that allows you to specify whether the popup should be shown or hidden.
414

515
## v0.1.7-beta.0
616

@@ -10,7 +20,7 @@
1020

1121
## v0.1.6
1222

13-
- Add `asGuest?: boolean` prop to `Chatbox`, `Inbox` and `Popup`
23+
- Added `asGuest?: boolean` prop to `Chatbox`, `Inbox` and `Popup`.
1424

1525
## v0.1.6-beta.0
1626

@@ -20,21 +30,21 @@
2030

2131
## v0.1.5
2232

23-
- Output ES2015
33+
- Output ES2015.
2434

2535
## v0.1.4
2636

27-
- Added `useUnreads` hook
37+
- Added `useUnreads` hook.
2838

2939

3040
## v0.1.3
3141

32-
- Add `signature?: string` prop to `Session`
42+
- Added `signature?: string` prop to `Session`.
3343

3444
## v0.1.2
3545

36-
- ~~Add `signature?: string` prop to `Session`~~
46+
- ~~Add `signature?: string` prop to `Session`.~~
3747

3848
## v0.1.1
3949

40-
- Remove "experimental" label from README
50+
- Removed "experimental" label from README.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ import { Session, Chatbox } from "@talkjs/react";
6868
function ChatComponent() {
6969
const syncUser = useCallback(
7070
() =>
71-
new Talk.User({
71+
return new Talk.User({
7272
id: "nina",
7373
name: "Nina",
7474

lib/Session.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ type SessionProps = UserProps &
1515
sessionRef?: React.MutableRefObject<Talk.Session | undefined>;
1616
desktopNotificationEnabled?: boolean;
1717
children?: ReactNode;
18+
token?: string;
19+
tokenFetcher?: () => Promise<string>;
1820
signature?: string;
1921
};
2022

@@ -26,6 +28,8 @@ export function Session(props: SessionProps) {
2628
userId,
2729
syncUser,
2830
appId,
31+
token,
32+
tokenFetcher,
2933
signature,
3034
sessionRef,
3135
desktopNotificationEnabled,
@@ -42,7 +46,7 @@ export function Session(props: SessionProps) {
4246
? syncUser()
4347
: syncUser ?? new Talk.User(userId);
4448

45-
const session = new Talk.Session({ appId, me, signature });
49+
const session = new Talk.Session({ appId, me, token, tokenFetcher, signature });
4650
setSession(session);
4751
if (sessionRef) {
4852
sessionRef.current = session;
@@ -52,7 +56,7 @@ export function Session(props: SessionProps) {
5256
// if appId or me changed, destroy (and then recreate) the entire
5357
// session.
5458
//
55-
// once the JSSDK supports proper progammatic user mutation, we can
59+
// once the JSSDK supports proper programmatic user mutation, we can
5660
// avoid recreating the session when `syncUser` changes.
5761
session.destroy();
5862
setSession(undefined);

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"url": "https://github.com/talkjs/talkjs-react/issues"
2929
},
3030
"homepage": "https://talkjs.com",
31-
"version": "0.1.8-beta.0",
31+
"version": "0.1.9-beta.0",
3232
"type": "module",
3333
"files": [
3434
"dist"
@@ -71,7 +71,7 @@
7171
"eslint-plugin-react-refresh": "^0.4.1",
7272
"react": "^18.2.0",
7373
"react-dom": "^18.2.0",
74-
"talkjs": "^0.16.3",
74+
"talkjs": "^0.21.0",
7575
"typescript": "^5.0.2",
7676
"vite": "^4.4.0",
7777
"vite-plugin-dts": "^3.5.1"

vite.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export default defineConfig({
3636
react: "React",
3737
talkjs: "TalkJS",
3838
},
39+
banner: `"use client";`,
3940
},
4041
},
4142
},

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -1479,10 +1479,10 @@ supports-preserve-symlinks-flag@^1.0.0:
14791479
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
14801480
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
14811481

1482-
talkjs@^0.16.3:
1483-
version "0.16.3"
1484-
resolved "https://registry.yarnpkg.com/talkjs/-/talkjs-0.16.3.tgz#90a811aea6d507b97a13c82d1ea42dcdd51ba9d7"
1485-
integrity sha512-8zwYJfdokAikZ0Rs/AXT28NPmnFQCnVWI4G7qXo8yTKg77bdNpv9EO0hin/SsSlOFleBDLAkBnnuaiFMEvyrNg==
1482+
talkjs@^0.21.0:
1483+
version "0.21.0"
1484+
resolved "https://registry.yarnpkg.com/talkjs/-/talkjs-0.21.0.tgz#8dd2ee2c46b8f203c6264b7d96745421dd594f64"
1485+
integrity sha512-k1fAyYKLKbNVlchsUnaiLgKVF9J6eynalY5AvxhdKpa0wSssIBVsilcbgPoAkSMWFNNCnPHU75jUfP9tdFPlag==
14861486

14871487
text-table@^0.2.0:
14881488
version "0.2.0"

0 commit comments

Comments
 (0)