@zerohash-sdk/onboarding-js 1.11.6 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -205,6 +205,16 @@ onLoaded: () => {
|
|
|
205
205
|
};
|
|
206
206
|
```
|
|
207
207
|
|
|
208
|
+
## JWT & token renewal
|
|
209
|
+
|
|
210
|
+
The `jwt` you pass is what the widget uses to authenticate (`updateConfig({ jwt })`
|
|
211
|
+
is the JS-SDK equivalent of `setJWT`).
|
|
212
|
+
|
|
213
|
+
**The SDK does not support refresh tokens.** It does not renew or re-authenticate
|
|
214
|
+
a token on its own — there is no built-in token-refresh mechanism. Token renewal
|
|
215
|
+
is handled entirely by the host: obtain a new JWT from your backend and provide
|
|
216
|
+
it to the SDK the same way you provided the initial one.
|
|
217
|
+
|
|
208
218
|
## Browser Support
|
|
209
219
|
|
|
210
220
|
- Chrome/Edge 90+
|
package/dist/index.d.ts
CHANGED
|
@@ -24,7 +24,8 @@ declare type AppEvent<TType extends string = string, TData = Record<string, unkn
|
|
|
24
24
|
*/
|
|
25
25
|
declare interface BaseConfig<TEvent = AppEvent> extends CommonCallbacks<TEvent> {
|
|
26
26
|
/**
|
|
27
|
-
* JWT token used for authentication
|
|
27
|
+
* JWT token used for authentication. Provide/update it via `setJWT`
|
|
28
|
+
* (`updateConfig({ jwt })`).
|
|
28
29
|
*/
|
|
29
30
|
jwt: string;
|
|
30
31
|
|
|
@@ -119,7 +120,11 @@ declare abstract class BaseJsSdk<Config extends BaseConfig<never> = BaseConfig>
|
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
/**
|
|
122
|
-
* Update the configuration of the widget
|
|
123
|
+
* Update the configuration of the widget (e.g. `theme`, or the `jwt`).
|
|
124
|
+
*
|
|
125
|
+
* Passing a `jwt` is the JS-SDK equivalent of `setJWT` — it provides the JWT
|
|
126
|
+
* used to authenticate.
|
|
127
|
+
*
|
|
123
128
|
* @param config - Partial configuration to update
|
|
124
129
|
* @returns void
|
|
125
130
|
*/
|
|
@@ -458,8 +463,6 @@ export default Onboarding;
|
|
|
458
463
|
declare type OnboardingCallbacks = CommonCallbacks<OnboardingEvent> & {
|
|
459
464
|
/** Called when the onboarding flow is successfully completed */
|
|
460
465
|
onCompleted?: (data: OnboardingCompletedData) => void;
|
|
461
|
-
/** Called when the widget has loaded and is ready */
|
|
462
|
-
onLoaded?: () => void;
|
|
463
466
|
};
|
|
464
467
|
|
|
465
468
|
declare type OnboardingCompletedData = {
|
package/dist/index.js
CHANGED
|
@@ -169,7 +169,11 @@ class j {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
|
-
* Update the configuration of the widget
|
|
172
|
+
* Update the configuration of the widget (e.g. `theme`, or the `jwt`).
|
|
173
|
+
*
|
|
174
|
+
* Passing a `jwt` is the JS-SDK equivalent of `setJWT` — it provides the JWT
|
|
175
|
+
* used to authenticate.
|
|
176
|
+
*
|
|
173
177
|
* @param config - Partial configuration to update
|
|
174
178
|
* @returns void
|
|
175
179
|
*/
|