@splitin/verification-adapter-stripe-identity 0.1.0-beta.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/LICENSE +21 -0
- package/NOTICE +32 -0
- package/README.md +49 -0
- package/dist/browser.cjs +43 -0
- package/dist/browser.cjs.map +1 -0
- package/dist/browser.d.cts +21 -0
- package/dist/browser.d.ts +21 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +40 -0
- package/dist/browser.js.map +1 -0
- package/dist/index.cjs +766 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +56 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +760 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SplitInTech
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Verification Adapter SDK
|
|
2
|
+
Copyright (c) 2026 SplitInTech
|
|
3
|
+
|
|
4
|
+
This product is licensed under the MIT License. See LICENSE.
|
|
5
|
+
|
|
6
|
+
Third-party notices
|
|
7
|
+
===================
|
|
8
|
+
|
|
9
|
+
This project redistributes no vendor identity SDKs in its core or server
|
|
10
|
+
packages. Optional peer dependencies used by browser plugins:
|
|
11
|
+
|
|
12
|
+
- `@stripe/stripe-js` — Stripe, Inc. (MIT). Used only by the Stripe Identity
|
|
13
|
+
browser plugin via dynamic import. Stripe is a trademark of Stripe, Inc.
|
|
14
|
+
- `persona` — Persona Identities, Inc. Used only by the Persona browser plugin
|
|
15
|
+
via dynamic import.
|
|
16
|
+
- `react-plaid-link` — Plaid Inc. (MIT). Used only by the Plaid Identity
|
|
17
|
+
Verification browser plugin via dynamic import. Plaid is a trademark of
|
|
18
|
+
Plaid Inc.
|
|
19
|
+
|
|
20
|
+
Server adapters speak HTTPS to provider APIs with an injected Fetch
|
|
21
|
+
implementation. They do not bundle Stripe, Persona, or Plaid Node SDKs.
|
|
22
|
+
|
|
23
|
+
Runtime and tooling (declared in package.json; not vendored):
|
|
24
|
+
|
|
25
|
+
- `ajv` — MIT
|
|
26
|
+
- `jose` — MIT (Plaid webhook JWT verification)
|
|
27
|
+
- `pg` — MIT (optional PostgreSQL executor)
|
|
28
|
+
- TypeScript, tsup, vitest, Changesets — Apache-2.0 / MIT as published by
|
|
29
|
+
their authors
|
|
30
|
+
|
|
31
|
+
This project provides engineering primitives. It is not a legal, KYC, KYB, or
|
|
32
|
+
regulatory compliance certification.
|
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# `@splitin/verification-adapter-stripe-identity`
|
|
2
|
+
|
|
3
|
+
Official Stripe Identity plugin for the Universal Open-Source Verification
|
|
4
|
+
Adapter SDK. This package covers **human document verification only**. Stripe
|
|
5
|
+
Connect, Payments, bank accounts, and payouts are out of scope.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @splitin/verification-adapter-stripe-identity @splitin/verification-adapter-sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Optional browser peer: `@stripe/stripe-js`.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
The adapter is constructed with an injected `ProviderRuntimeContext`. It never
|
|
18
|
+
reads environment variables, databases, or sessions. API calls always go to
|
|
19
|
+
`api.stripe.com` (code-owned). Configuration cannot override the production API
|
|
20
|
+
origin.
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { createDefaultRuntime } from '@splitin/verification-adapter-sdk';
|
|
24
|
+
import {
|
|
25
|
+
StripeIdentityVerificationAdapter,
|
|
26
|
+
createStripeIdentityConfiguration,
|
|
27
|
+
stripeIdentityProviderManifest,
|
|
28
|
+
} from '@splitin/verification-adapter-stripe-identity';
|
|
29
|
+
|
|
30
|
+
const configuration = createStripeIdentityConfiguration(process.env);
|
|
31
|
+
const runtime = createDefaultRuntime('sandbox', configuration, {
|
|
32
|
+
allowedHosts: stripeIdentityProviderManifest.apiHosts,
|
|
33
|
+
});
|
|
34
|
+
const adapter = new StripeIdentityVerificationAdapter(runtime);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Restricted keys must match the runtime environment (`rk_test_` sandbox,
|
|
38
|
+
`rk_live_` production). The API version is pinned to `2025-08-27.basil`.
|
|
39
|
+
Set `requireMatchingSelfie: true` to require a matching selfie in addition to
|
|
40
|
+
the identity document.
|
|
41
|
+
|
|
42
|
+
Launch envelopes follow contract V1: `transientSecret` is memory-only and is
|
|
43
|
+
never logged or persisted. Hosted fallback URLs use `verify.stripe.com`.
|
|
44
|
+
|
|
45
|
+
The browser entry (`@splitin/verification-adapter-stripe-identity/browser`)
|
|
46
|
+
exports a `stripe_identity` launcher plugin that dynamically imports
|
|
47
|
+
`@stripe/stripe-js`. Browser callbacks are UX signals only.
|
|
48
|
+
|
|
49
|
+
This package is not a compliance certification.
|
package/dist/browser.cjs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/browser.ts
|
|
4
|
+
var stripeIdentityLauncherKey = "stripe_identity";
|
|
5
|
+
var stripeIdentityBrowserPlugin = Object.freeze({
|
|
6
|
+
launcherKey: stripeIdentityLauncherKey,
|
|
7
|
+
async launch(input) {
|
|
8
|
+
if (!input.transientSecret) {
|
|
9
|
+
throw new Error("Stripe Identity embedded launch requires a memory-only transient secret.");
|
|
10
|
+
}
|
|
11
|
+
const stripeJs = await loadStripeJs();
|
|
12
|
+
const stripe = await stripeJs.loadStripe(input.publishableKey);
|
|
13
|
+
if (!stripe || typeof stripe.verifyIdentity !== "function") {
|
|
14
|
+
throw new Error("Stripe.js did not return an Identity-capable instance.");
|
|
15
|
+
}
|
|
16
|
+
let cancelled = false;
|
|
17
|
+
void stripe.verifyIdentity(input.transientSecret).then((result) => {
|
|
18
|
+
if (cancelled) return;
|
|
19
|
+
if (result?.error) input.onUxSignal?.("error");
|
|
20
|
+
else input.onUxSignal?.("complete");
|
|
21
|
+
}).catch(() => {
|
|
22
|
+
if (!cancelled) input.onUxSignal?.("error");
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
unmount() {
|
|
26
|
+
cancelled = true;
|
|
27
|
+
input.onUxSignal?.("cancel");
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
async function loadStripeJs() {
|
|
33
|
+
try {
|
|
34
|
+
return await import('@stripe/stripe-js');
|
|
35
|
+
} catch {
|
|
36
|
+
throw new Error("Optional peer dependency @stripe/stripe-js is not installed.");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
exports.stripeIdentityBrowserPlugin = stripeIdentityBrowserPlugin;
|
|
41
|
+
exports.stripeIdentityLauncherKey = stripeIdentityLauncherKey;
|
|
42
|
+
//# sourceMappingURL=browser.cjs.map
|
|
43
|
+
//# sourceMappingURL=browser.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/browser.ts"],"names":[],"mappings":";;;AAQO,IAAM,yBAAA,GAA4B;AAQlC,IAAM,2BAAA,GAA8B,OAAO,MAAA,CAAO;AAAA,EACvD,WAAA,EAAa,yBAAA;AAAA,EACb,MAAM,OAAO,KAAA,EAAuE;AAClF,IAAA,IAAI,CAAC,MAAM,eAAA,EAAiB;AAC1B,MAAA,MAAM,IAAI,MAAM,0EAA0E,CAAA;AAAA,IAC5F;AACA,IAAA,MAAM,QAAA,GAAW,MAAM,YAAA,EAAa;AACpC,IAAA,MAAM,MAAA,GAAS,MAAM,QAAA,CAAS,UAAA,CAAW,MAAM,cAAc,CAAA;AAC7D,IAAA,IAAI,CAAC,MAAA,IAAU,OAAO,MAAA,CAAO,mBAAmB,UAAA,EAAY;AAC1D,MAAA,MAAM,IAAI,MAAM,wDAAwD,CAAA;AAAA,IAC1E;AACA,IAAA,IAAI,SAAA,GAAY,KAAA;AAChB,IAAA,KAAK,OAAO,cAAA,CAAe,KAAA,CAAM,eAAe,CAAA,CAAE,IAAA,CAAK,CAAC,MAAA,KAAW;AACjE,MAAA,IAAI,SAAA,EAAW;AACf,MAAA,IAAI,MAAA,EAAQ,KAAA,EAAO,KAAA,CAAM,UAAA,GAAa,OAAO,CAAA;AAAA,WACxC,KAAA,CAAM,aAAa,UAAU,CAAA;AAAA,IACpC,CAAC,CAAA,CAAE,KAAA,CAAM,MAAM;AACb,MAAA,IAAI,CAAC,SAAA,EAAW,KAAA,CAAM,UAAA,GAAa,OAAO,CAAA;AAAA,IAC5C,CAAC,CAAA;AACD,IAAA,OAAO;AAAA,MACL,OAAA,GAAU;AACR,QAAA,SAAA,GAAY,IAAA;AACZ,QAAA,KAAA,CAAM,aAAa,QAAQ,CAAA;AAAA,MAC7B;AAAA,KACF;AAAA,EACF;AACF,CAAC;AAED,eAAe,YAAA,GAAwC;AACrD,EAAA,IAAI;AACF,IAAA,OAAO,MAAM,OAAO,mBAAmB,CAAA;AAAA,EACzC,CAAA,CAAA,MAAQ;AACN,IAAA,MAAM,IAAI,MAAM,8DAA8D,CAAA;AAAA,EAChF;AACF","file":"browser.cjs","sourcesContent":["/**\n * Browser launcher for Stripe Identity embedded verification.\n *\n * Dynamically imports optional peer `@stripe/stripe-js`. Hosts must pass a\n * publishable key; restricted keys never leave the server adapter.\n * Browser callbacks are UX signals only — canonical status comes from the engine.\n */\n\nexport const stripeIdentityLauncherKey = 'stripe_identity' as const;\n\nexport interface StripeIdentityBrowserLaunchInput {\n publishableKey: string;\n transientSecret: string;\n onUxSignal?: (signal: 'complete' | 'cancel' | 'error') => void;\n}\n\nexport const stripeIdentityBrowserPlugin = Object.freeze({\n launcherKey: stripeIdentityLauncherKey,\n async launch(input: StripeIdentityBrowserLaunchInput): Promise<{ unmount(): void }> {\n if (!input.transientSecret) {\n throw new Error('Stripe Identity embedded launch requires a memory-only transient secret.');\n }\n const stripeJs = await loadStripeJs();\n const stripe = await stripeJs.loadStripe(input.publishableKey);\n if (!stripe || typeof stripe.verifyIdentity !== 'function') {\n throw new Error('Stripe.js did not return an Identity-capable instance.');\n }\n let cancelled = false;\n void stripe.verifyIdentity(input.transientSecret).then((result) => {\n if (cancelled) return;\n if (result?.error) input.onUxSignal?.('error');\n else input.onUxSignal?.('complete');\n }).catch(() => {\n if (!cancelled) input.onUxSignal?.('error');\n });\n return {\n unmount() {\n cancelled = true;\n input.onUxSignal?.('cancel');\n },\n };\n },\n});\n\nasync function loadStripeJs(): Promise<StripeJsModule> {\n try {\n return await import('@stripe/stripe-js') as StripeJsModule;\n } catch {\n throw new Error('Optional peer dependency @stripe/stripe-js is not installed.');\n }\n}\n\ninterface StripeJsModule {\n loadStripe(key: string): Promise<{\n verifyIdentity(clientSecret: string): Promise<{ error?: { type?: string } | null }>;\n } | null>;\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser launcher for Stripe Identity embedded verification.
|
|
3
|
+
*
|
|
4
|
+
* Dynamically imports optional peer `@stripe/stripe-js`. Hosts must pass a
|
|
5
|
+
* publishable key; restricted keys never leave the server adapter.
|
|
6
|
+
* Browser callbacks are UX signals only — canonical status comes from the engine.
|
|
7
|
+
*/
|
|
8
|
+
declare const stripeIdentityLauncherKey: "stripe_identity";
|
|
9
|
+
interface StripeIdentityBrowserLaunchInput {
|
|
10
|
+
publishableKey: string;
|
|
11
|
+
transientSecret: string;
|
|
12
|
+
onUxSignal?: (signal: 'complete' | 'cancel' | 'error') => void;
|
|
13
|
+
}
|
|
14
|
+
declare const stripeIdentityBrowserPlugin: Readonly<{
|
|
15
|
+
launcherKey: "stripe_identity";
|
|
16
|
+
launch(input: StripeIdentityBrowserLaunchInput): Promise<{
|
|
17
|
+
unmount(): void;
|
|
18
|
+
}>;
|
|
19
|
+
}>;
|
|
20
|
+
|
|
21
|
+
export { type StripeIdentityBrowserLaunchInput, stripeIdentityBrowserPlugin, stripeIdentityLauncherKey };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser launcher for Stripe Identity embedded verification.
|
|
3
|
+
*
|
|
4
|
+
* Dynamically imports optional peer `@stripe/stripe-js`. Hosts must pass a
|
|
5
|
+
* publishable key; restricted keys never leave the server adapter.
|
|
6
|
+
* Browser callbacks are UX signals only — canonical status comes from the engine.
|
|
7
|
+
*/
|
|
8
|
+
declare const stripeIdentityLauncherKey: "stripe_identity";
|
|
9
|
+
interface StripeIdentityBrowserLaunchInput {
|
|
10
|
+
publishableKey: string;
|
|
11
|
+
transientSecret: string;
|
|
12
|
+
onUxSignal?: (signal: 'complete' | 'cancel' | 'error') => void;
|
|
13
|
+
}
|
|
14
|
+
declare const stripeIdentityBrowserPlugin: Readonly<{
|
|
15
|
+
launcherKey: "stripe_identity";
|
|
16
|
+
launch(input: StripeIdentityBrowserLaunchInput): Promise<{
|
|
17
|
+
unmount(): void;
|
|
18
|
+
}>;
|
|
19
|
+
}>;
|
|
20
|
+
|
|
21
|
+
export { type StripeIdentityBrowserLaunchInput, stripeIdentityBrowserPlugin, stripeIdentityLauncherKey };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sources":["browser.d.ts"],"names":[],"mappings":"AAAA"}
|
package/dist/browser.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// src/browser.ts
|
|
2
|
+
var stripeIdentityLauncherKey = "stripe_identity";
|
|
3
|
+
var stripeIdentityBrowserPlugin = Object.freeze({
|
|
4
|
+
launcherKey: stripeIdentityLauncherKey,
|
|
5
|
+
async launch(input) {
|
|
6
|
+
if (!input.transientSecret) {
|
|
7
|
+
throw new Error("Stripe Identity embedded launch requires a memory-only transient secret.");
|
|
8
|
+
}
|
|
9
|
+
const stripeJs = await loadStripeJs();
|
|
10
|
+
const stripe = await stripeJs.loadStripe(input.publishableKey);
|
|
11
|
+
if (!stripe || typeof stripe.verifyIdentity !== "function") {
|
|
12
|
+
throw new Error("Stripe.js did not return an Identity-capable instance.");
|
|
13
|
+
}
|
|
14
|
+
let cancelled = false;
|
|
15
|
+
void stripe.verifyIdentity(input.transientSecret).then((result) => {
|
|
16
|
+
if (cancelled) return;
|
|
17
|
+
if (result?.error) input.onUxSignal?.("error");
|
|
18
|
+
else input.onUxSignal?.("complete");
|
|
19
|
+
}).catch(() => {
|
|
20
|
+
if (!cancelled) input.onUxSignal?.("error");
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
unmount() {
|
|
24
|
+
cancelled = true;
|
|
25
|
+
input.onUxSignal?.("cancel");
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
async function loadStripeJs() {
|
|
31
|
+
try {
|
|
32
|
+
return await import('@stripe/stripe-js');
|
|
33
|
+
} catch {
|
|
34
|
+
throw new Error("Optional peer dependency @stripe/stripe-js is not installed.");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { stripeIdentityBrowserPlugin, stripeIdentityLauncherKey };
|
|
39
|
+
//# sourceMappingURL=browser.js.map
|
|
40
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/browser.ts"],"names":[],"mappings":";AAQO,IAAM,yBAAA,GAA4B;AAQlC,IAAM,2BAAA,GAA8B,OAAO,MAAA,CAAO;AAAA,EACvD,WAAA,EAAa,yBAAA;AAAA,EACb,MAAM,OAAO,KAAA,EAAuE;AAClF,IAAA,IAAI,CAAC,MAAM,eAAA,EAAiB;AAC1B,MAAA,MAAM,IAAI,MAAM,0EAA0E,CAAA;AAAA,IAC5F;AACA,IAAA,MAAM,QAAA,GAAW,MAAM,YAAA,EAAa;AACpC,IAAA,MAAM,MAAA,GAAS,MAAM,QAAA,CAAS,UAAA,CAAW,MAAM,cAAc,CAAA;AAC7D,IAAA,IAAI,CAAC,MAAA,IAAU,OAAO,MAAA,CAAO,mBAAmB,UAAA,EAAY;AAC1D,MAAA,MAAM,IAAI,MAAM,wDAAwD,CAAA;AAAA,IAC1E;AACA,IAAA,IAAI,SAAA,GAAY,KAAA;AAChB,IAAA,KAAK,OAAO,cAAA,CAAe,KAAA,CAAM,eAAe,CAAA,CAAE,IAAA,CAAK,CAAC,MAAA,KAAW;AACjE,MAAA,IAAI,SAAA,EAAW;AACf,MAAA,IAAI,MAAA,EAAQ,KAAA,EAAO,KAAA,CAAM,UAAA,GAAa,OAAO,CAAA;AAAA,WACxC,KAAA,CAAM,aAAa,UAAU,CAAA;AAAA,IACpC,CAAC,CAAA,CAAE,KAAA,CAAM,MAAM;AACb,MAAA,IAAI,CAAC,SAAA,EAAW,KAAA,CAAM,UAAA,GAAa,OAAO,CAAA;AAAA,IAC5C,CAAC,CAAA;AACD,IAAA,OAAO;AAAA,MACL,OAAA,GAAU;AACR,QAAA,SAAA,GAAY,IAAA;AACZ,QAAA,KAAA,CAAM,aAAa,QAAQ,CAAA;AAAA,MAC7B;AAAA,KACF;AAAA,EACF;AACF,CAAC;AAED,eAAe,YAAA,GAAwC;AACrD,EAAA,IAAI;AACF,IAAA,OAAO,MAAM,OAAO,mBAAmB,CAAA;AAAA,EACzC,CAAA,CAAA,MAAQ;AACN,IAAA,MAAM,IAAI,MAAM,8DAA8D,CAAA;AAAA,EAChF;AACF","file":"browser.js","sourcesContent":["/**\n * Browser launcher for Stripe Identity embedded verification.\n *\n * Dynamically imports optional peer `@stripe/stripe-js`. Hosts must pass a\n * publishable key; restricted keys never leave the server adapter.\n * Browser callbacks are UX signals only — canonical status comes from the engine.\n */\n\nexport const stripeIdentityLauncherKey = 'stripe_identity' as const;\n\nexport interface StripeIdentityBrowserLaunchInput {\n publishableKey: string;\n transientSecret: string;\n onUxSignal?: (signal: 'complete' | 'cancel' | 'error') => void;\n}\n\nexport const stripeIdentityBrowserPlugin = Object.freeze({\n launcherKey: stripeIdentityLauncherKey,\n async launch(input: StripeIdentityBrowserLaunchInput): Promise<{ unmount(): void }> {\n if (!input.transientSecret) {\n throw new Error('Stripe Identity embedded launch requires a memory-only transient secret.');\n }\n const stripeJs = await loadStripeJs();\n const stripe = await stripeJs.loadStripe(input.publishableKey);\n if (!stripe || typeof stripe.verifyIdentity !== 'function') {\n throw new Error('Stripe.js did not return an Identity-capable instance.');\n }\n let cancelled = false;\n void stripe.verifyIdentity(input.transientSecret).then((result) => {\n if (cancelled) return;\n if (result?.error) input.onUxSignal?.('error');\n else input.onUxSignal?.('complete');\n }).catch(() => {\n if (!cancelled) input.onUxSignal?.('error');\n });\n return {\n unmount() {\n cancelled = true;\n input.onUxSignal?.('cancel');\n },\n };\n },\n});\n\nasync function loadStripeJs(): Promise<StripeJsModule> {\n try {\n return await import('@stripe/stripe-js') as StripeJsModule;\n } catch {\n throw new Error('Optional peer dependency @stripe/stripe-js is not installed.');\n }\n}\n\ninterface StripeJsModule {\n loadStripe(key: string): Promise<{\n verifyIdentity(clientSecret: string): Promise<{ error?: { type?: string } | null }>;\n } | null>;\n}\n"]}
|