@zerohash-sdk/onboarding-react 1.15.5 → 1.15.7
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 +4 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +16 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -139,6 +139,10 @@ export default App;
|
|
|
139
139
|
| `onEvent` | `({ type, data }) => void` | No | - | Callback for general events |
|
|
140
140
|
| `onLoaded` | `() => void` | No | - | Callback when the widget is loaded and ready |
|
|
141
141
|
|
|
142
|
+
> **`onboardingFlow: "tax_only"`:** no KYC runs in this flow. `onCompleted` fires once the tax
|
|
143
|
+
> certification is saved, with the participant's existing KYC status when it is known, otherwise
|
|
144
|
+
> `kycStatus: "UNKNOWN"`. Don't treat it as a new KYC result.
|
|
145
|
+
|
|
142
146
|
## JWT & token renewal
|
|
143
147
|
|
|
144
148
|
The `jwt` prop is what the widget uses to authenticate.
|
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ declare type ErrorPayload = {
|
|
|
61
61
|
* @param jwt - JWT token for authentication (required)
|
|
62
62
|
* @param env - Target environment ("local" | "dev" | "cert" | "prod"). Omit for prod; init-only
|
|
63
63
|
* @param theme - Theme mode ("auto" | "light" | "dark", defaults to "auto")
|
|
64
|
+
* @param onboardingFlow - Onboarding experience ("full_with_tax" | "full_without_tax" | "tax_only"); init-only
|
|
64
65
|
* @param onCompleted - Callback invoked when the sell flow is successfully completed
|
|
65
66
|
* @param onError - Callback invoked when an error occurs
|
|
66
67
|
* @param onClose - Callback invoked when the user closes the widget
|
|
@@ -103,6 +104,15 @@ declare type OnboardingEvent = AppEvent<OnboardingEventType>;
|
|
|
103
104
|
|
|
104
105
|
declare type OnboardingEventType = string;
|
|
105
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Onboarding experience to render.
|
|
109
|
+
*
|
|
110
|
+
* - `"full_with_tax"` - Full onboarding plus brokerage tax certification
|
|
111
|
+
* - `"full_without_tax"` - Full onboarding, no tax certification
|
|
112
|
+
* - `"tax_only"` - Tax certification only, for existing participants
|
|
113
|
+
*/
|
|
114
|
+
export declare type OnboardingFlow = 'full_with_tax' | 'full_without_tax' | 'tax_only';
|
|
115
|
+
|
|
106
116
|
declare interface OnboardingProps {
|
|
107
117
|
/**
|
|
108
118
|
* JWT token used for authentication with the Connect Onboarding service.
|
|
@@ -161,6 +171,16 @@ declare interface OnboardingProps {
|
|
|
161
171
|
* ```
|
|
162
172
|
*/
|
|
163
173
|
theme?: Theme;
|
|
174
|
+
/**
|
|
175
|
+
* Onboarding experience to render. Optional; when omitted the default
|
|
176
|
+
* experience is used. Init-only: post-mount changes are ignored.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```tsx
|
|
180
|
+
* <Onboarding jwt={token} onboardingFlow="full_without_tax" />
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
onboardingFlow?: OnboardingFlow;
|
|
164
184
|
/**
|
|
165
185
|
* Callback invoked when the crypto sell flow is successfully completed.
|
|
166
186
|
*
|
|
@@ -265,6 +285,11 @@ declare global {
|
|
|
265
285
|
* Theme mode ("auto" | "light" | "dark")
|
|
266
286
|
*/
|
|
267
287
|
theme?: Theme;
|
|
288
|
+
/**
|
|
289
|
+
* Onboarding experience to render. camelCase so React 19 sets it as a
|
|
290
|
+
* property before `connectedCallback` runs.
|
|
291
|
+
*/
|
|
292
|
+
onboardingFlow?: OnboardingFlow;
|
|
268
293
|
};
|
|
269
294
|
}
|
|
270
295
|
}
|
package/dist/index.js
CHANGED
|
@@ -308,31 +308,33 @@ var S = {
|
|
|
308
308
|
loadFailed: m,
|
|
309
309
|
retry: r(() => v((e) => e + 1), [])
|
|
310
310
|
};
|
|
311
|
-
}, E = b("onboarding-web", "index.js", { eu: !0 }), D = "zerohash-onboarding", O = ({ jwt: t, env: r = "prod", theme: i,
|
|
312
|
-
let
|
|
313
|
-
w(
|
|
311
|
+
}, E = b("onboarding-web", "index.js", { eu: !0 }), D = "zerohash-onboarding", O = ({ jwt: t, env: r = "prod", theme: i, onboardingFlow: o, onCompleted: s, onError: c, onClose: l, onLoaded: u, onEvent: d, ...f }) => {
|
|
312
|
+
let p = a(null);
|
|
313
|
+
w(p, {
|
|
314
314
|
theme: i,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
315
|
+
onboardingFlow: o,
|
|
316
|
+
onCompleted: s,
|
|
317
|
+
onError: c,
|
|
318
|
+
onClose: l,
|
|
319
|
+
onLoaded: u,
|
|
320
|
+
onEvent: d
|
|
320
321
|
});
|
|
321
|
-
let { loadFailed:
|
|
322
|
+
let { loadFailed: m, retry: h } = T({
|
|
322
323
|
webComponentTag: D,
|
|
323
324
|
scriptUrls: E,
|
|
324
325
|
env: r,
|
|
325
326
|
jwt: t
|
|
326
327
|
});
|
|
327
|
-
return
|
|
328
|
-
onRetry:
|
|
329
|
-
onClose:
|
|
328
|
+
return m ? /* @__PURE__ */ e(C, {
|
|
329
|
+
onRetry: h,
|
|
330
|
+
onClose: l
|
|
330
331
|
}) : n.createElement(D, {
|
|
331
|
-
ref:
|
|
332
|
+
ref: p,
|
|
332
333
|
jwt: t,
|
|
333
334
|
env: r,
|
|
334
335
|
theme: i,
|
|
335
|
-
|
|
336
|
+
onboardingFlow: o,
|
|
337
|
+
...f
|
|
336
338
|
});
|
|
337
339
|
};
|
|
338
340
|
//#endregion
|