@splitin/verification-adapter-persona 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 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,45 @@
1
+ # `@splitin/verification-adapter-persona`
2
+
3
+ Official Persona plugin for the Universal Open-Source Verification Adapter SDK.
4
+
5
+ Supported packages: `human_idv`, `business_kyb`, `associated_person_idv`,
6
+ `ownership_review`. Documents remain at Persona; this adapter returns opaque
7
+ evidence references only.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install @splitin/verification-adapter-persona @splitin/verification-adapter-sdk
13
+ ```
14
+
15
+ Optional browser peer: `persona`.
16
+
17
+ ## Usage
18
+
19
+ Construct with an injected `ProviderRuntimeContext`. The adapter never reads
20
+ environment variables. HTTP always targets `api.withpersona.com`.
21
+
22
+ ```ts
23
+ import { createDefaultRuntime } from '@splitin/verification-adapter-sdk';
24
+ import {
25
+ PersonaVerificationAdapter,
26
+ createPersonaConfiguration,
27
+ personaProviderManifest,
28
+ } from '@splitin/verification-adapter-persona';
29
+
30
+ const configuration = createPersonaConfiguration(process.env);
31
+ const runtime = createDefaultRuntime('sandbox', configuration, {
32
+ allowedHosts: personaProviderManifest.apiHosts,
33
+ });
34
+ const adapter = new PersonaVerificationAdapter(runtime);
35
+ ```
36
+
37
+ Published template and workflow versions are required. Production must supply
38
+ HTTPS embedding origins. Webhook verification uses timestamped HMAC over the
39
+ exact raw body and accepts current plus previous secrets.
40
+
41
+ The browser entry (`@splitin/verification-adapter-persona/browser`) exports a
42
+ `persona_embedded` launcher. Browser `onComplete` / `onCancel` callbacks are UX
43
+ signals only; canonical status is owned by the engine.
44
+
45
+ This package is not a compliance certification.
@@ -0,0 +1,42 @@
1
+ 'use strict';
2
+
3
+ // src/browser.ts
4
+ var personaEmbeddedLauncherKey = "persona_embedded";
5
+ var personaBrowserPlugin = Object.freeze({
6
+ launcherKey: personaEmbeddedLauncherKey,
7
+ async launch(input) {
8
+ const persona = await loadPersona();
9
+ const Client = persona.Client ?? persona.default?.Client;
10
+ if (typeof Client !== "function") {
11
+ throw new Error("Persona browser SDK did not export Client.");
12
+ }
13
+ const client = new Client({
14
+ inquiryId: input.inquiryId,
15
+ sessionToken: input.transientSecret,
16
+ environment: input.environment,
17
+ onComplete: () => input.onUxSignal?.("complete"),
18
+ onCancel: () => input.onUxSignal?.("cancel"),
19
+ onError: () => input.onUxSignal?.("error"),
20
+ onEvent: () => input.onUxSignal?.("event")
21
+ });
22
+ client.open();
23
+ return {
24
+ unmount() {
25
+ client.destroy?.();
26
+ input.onUxSignal?.("cancel");
27
+ }
28
+ };
29
+ }
30
+ });
31
+ async function loadPersona() {
32
+ try {
33
+ return await import('persona');
34
+ } catch {
35
+ throw new Error("Optional peer dependency persona is not installed.");
36
+ }
37
+ }
38
+
39
+ exports.personaBrowserPlugin = personaBrowserPlugin;
40
+ exports.personaEmbeddedLauncherKey = personaEmbeddedLauncherKey;
41
+ //# sourceMappingURL=browser.cjs.map
42
+ //# sourceMappingURL=browser.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/browser.ts"],"names":[],"mappings":";;;AAQO,IAAM,0BAAA,GAA6B;AAUnC,IAAM,oBAAA,GAAuB,OAAO,MAAA,CAAO;AAAA,EAChD,WAAA,EAAa,0BAAA;AAAA,EACb,MAAM,OAAO,KAAA,EAAgE;AAC3E,IAAA,MAAM,OAAA,GAAU,MAAM,WAAA,EAAY;AAClC,IAAA,MAAM,MAAA,GAAS,OAAA,CAAQ,MAAA,IAAU,OAAA,CAAQ,OAAA,EAAS,MAAA;AAClD,IAAA,IAAI,OAAO,WAAW,UAAA,EAAY;AAChC,MAAA,MAAM,IAAI,MAAM,4CAA4C,CAAA;AAAA,IAC9D;AACA,IAAA,MAAM,MAAA,GAAS,IAAI,MAAA,CAAO;AAAA,MACxB,WAAW,KAAA,CAAM,SAAA;AAAA,MACjB,cAAc,KAAA,CAAM,eAAA;AAAA,MACpB,aAAa,KAAA,CAAM,WAAA;AAAA,MACnB,UAAA,EAAY,MAAM,KAAA,CAAM,UAAA,GAAa,UAAU,CAAA;AAAA,MAC/C,QAAA,EAAU,MAAM,KAAA,CAAM,UAAA,GAAa,QAAQ,CAAA;AAAA,MAC3C,OAAA,EAAS,MAAM,KAAA,CAAM,UAAA,GAAa,OAAO,CAAA;AAAA,MACzC,OAAA,EAAS,MAAM,KAAA,CAAM,UAAA,GAAa,OAAO;AAAA,KAC1C,CAAA;AACD,IAAA,MAAA,CAAO,IAAA,EAAK;AACZ,IAAA,OAAO;AAAA,MACL,OAAA,GAAU;AACR,QAAA,MAAA,CAAO,OAAA,IAAU;AACjB,QAAA,KAAA,CAAM,aAAa,QAAQ,CAAA;AAAA,MAC7B;AAAA,KACF;AAAA,EACF;AACF,CAAC;AAED,eAAe,WAAA,GAAsC;AACnD,EAAA,IAAI;AACF,IAAA,OAAO,MAAM,OAAO,SAAS,CAAA;AAAA,EAC/B,CAAA,CAAA,MAAQ;AACN,IAAA,MAAM,IAAI,MAAM,oDAAoD,CAAA;AAAA,EACtE;AACF","file":"browser.cjs","sourcesContent":["/**\n * Browser launcher for Persona embedded inquiries.\n *\n * Dynamically imports optional peer `persona`. Browser callbacks are UX\n * signals only — they must not be treated as canonical verification decisions.\n * Documents stay at Persona; this plugin never receives document bytes.\n */\n\nexport const personaEmbeddedLauncherKey = 'persona_embedded' as const;\n\nexport interface PersonaBrowserLaunchInput {\n container?: HTMLElement;\n inquiryId?: string;\n transientSecret?: string;\n environment?: 'sandbox' | 'production';\n onUxSignal?: (signal: 'complete' | 'cancel' | 'error' | 'event') => void;\n}\n\nexport const personaBrowserPlugin = Object.freeze({\n launcherKey: personaEmbeddedLauncherKey,\n async launch(input: PersonaBrowserLaunchInput): Promise<{ unmount(): void }> {\n const persona = await loadPersona();\n const Client = persona.Client ?? persona.default?.Client;\n if (typeof Client !== 'function') {\n throw new Error('Persona browser SDK did not export Client.');\n }\n const client = new Client({\n inquiryId: input.inquiryId,\n sessionToken: input.transientSecret,\n environment: input.environment,\n onComplete: () => input.onUxSignal?.('complete'),\n onCancel: () => input.onUxSignal?.('cancel'),\n onError: () => input.onUxSignal?.('error'),\n onEvent: () => input.onUxSignal?.('event'),\n });\n client.open();\n return {\n unmount() {\n client.destroy?.();\n input.onUxSignal?.('cancel');\n },\n };\n },\n});\n\nasync function loadPersona(): Promise<PersonaModule> {\n try {\n return await import('persona') as PersonaModule;\n } catch {\n throw new Error('Optional peer dependency persona is not installed.');\n }\n}\n\ninterface PersonaClient {\n open(): void;\n destroy?: () => void;\n}\n\ninterface PersonaModule {\n Client?: new (options: Record<string, unknown>) => PersonaClient;\n default?: { Client?: new (options: Record<string, unknown>) => PersonaClient };\n}\n"]}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Browser launcher for Persona embedded inquiries.
3
+ *
4
+ * Dynamically imports optional peer `persona`. Browser callbacks are UX
5
+ * signals only — they must not be treated as canonical verification decisions.
6
+ * Documents stay at Persona; this plugin never receives document bytes.
7
+ */
8
+ declare const personaEmbeddedLauncherKey: "persona_embedded";
9
+ interface PersonaBrowserLaunchInput {
10
+ container?: HTMLElement;
11
+ inquiryId?: string;
12
+ transientSecret?: string;
13
+ environment?: 'sandbox' | 'production';
14
+ onUxSignal?: (signal: 'complete' | 'cancel' | 'error' | 'event') => void;
15
+ }
16
+ declare const personaBrowserPlugin: Readonly<{
17
+ launcherKey: "persona_embedded";
18
+ launch(input: PersonaBrowserLaunchInput): Promise<{
19
+ unmount(): void;
20
+ }>;
21
+ }>;
22
+
23
+ export { type PersonaBrowserLaunchInput, personaBrowserPlugin, personaEmbeddedLauncherKey };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Browser launcher for Persona embedded inquiries.
3
+ *
4
+ * Dynamically imports optional peer `persona`. Browser callbacks are UX
5
+ * signals only — they must not be treated as canonical verification decisions.
6
+ * Documents stay at Persona; this plugin never receives document bytes.
7
+ */
8
+ declare const personaEmbeddedLauncherKey: "persona_embedded";
9
+ interface PersonaBrowserLaunchInput {
10
+ container?: HTMLElement;
11
+ inquiryId?: string;
12
+ transientSecret?: string;
13
+ environment?: 'sandbox' | 'production';
14
+ onUxSignal?: (signal: 'complete' | 'cancel' | 'error' | 'event') => void;
15
+ }
16
+ declare const personaBrowserPlugin: Readonly<{
17
+ launcherKey: "persona_embedded";
18
+ launch(input: PersonaBrowserLaunchInput): Promise<{
19
+ unmount(): void;
20
+ }>;
21
+ }>;
22
+
23
+ export { type PersonaBrowserLaunchInput, personaBrowserPlugin, personaEmbeddedLauncherKey };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sources":["browser.d.ts"],"names":[],"mappings":"AAAA"}
@@ -0,0 +1,39 @@
1
+ // src/browser.ts
2
+ var personaEmbeddedLauncherKey = "persona_embedded";
3
+ var personaBrowserPlugin = Object.freeze({
4
+ launcherKey: personaEmbeddedLauncherKey,
5
+ async launch(input) {
6
+ const persona = await loadPersona();
7
+ const Client = persona.Client ?? persona.default?.Client;
8
+ if (typeof Client !== "function") {
9
+ throw new Error("Persona browser SDK did not export Client.");
10
+ }
11
+ const client = new Client({
12
+ inquiryId: input.inquiryId,
13
+ sessionToken: input.transientSecret,
14
+ environment: input.environment,
15
+ onComplete: () => input.onUxSignal?.("complete"),
16
+ onCancel: () => input.onUxSignal?.("cancel"),
17
+ onError: () => input.onUxSignal?.("error"),
18
+ onEvent: () => input.onUxSignal?.("event")
19
+ });
20
+ client.open();
21
+ return {
22
+ unmount() {
23
+ client.destroy?.();
24
+ input.onUxSignal?.("cancel");
25
+ }
26
+ };
27
+ }
28
+ });
29
+ async function loadPersona() {
30
+ try {
31
+ return await import('persona');
32
+ } catch {
33
+ throw new Error("Optional peer dependency persona is not installed.");
34
+ }
35
+ }
36
+
37
+ export { personaBrowserPlugin, personaEmbeddedLauncherKey };
38
+ //# sourceMappingURL=browser.js.map
39
+ //# sourceMappingURL=browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/browser.ts"],"names":[],"mappings":";AAQO,IAAM,0BAAA,GAA6B;AAUnC,IAAM,oBAAA,GAAuB,OAAO,MAAA,CAAO;AAAA,EAChD,WAAA,EAAa,0BAAA;AAAA,EACb,MAAM,OAAO,KAAA,EAAgE;AAC3E,IAAA,MAAM,OAAA,GAAU,MAAM,WAAA,EAAY;AAClC,IAAA,MAAM,MAAA,GAAS,OAAA,CAAQ,MAAA,IAAU,OAAA,CAAQ,OAAA,EAAS,MAAA;AAClD,IAAA,IAAI,OAAO,WAAW,UAAA,EAAY;AAChC,MAAA,MAAM,IAAI,MAAM,4CAA4C,CAAA;AAAA,IAC9D;AACA,IAAA,MAAM,MAAA,GAAS,IAAI,MAAA,CAAO;AAAA,MACxB,WAAW,KAAA,CAAM,SAAA;AAAA,MACjB,cAAc,KAAA,CAAM,eAAA;AAAA,MACpB,aAAa,KAAA,CAAM,WAAA;AAAA,MACnB,UAAA,EAAY,MAAM,KAAA,CAAM,UAAA,GAAa,UAAU,CAAA;AAAA,MAC/C,QAAA,EAAU,MAAM,KAAA,CAAM,UAAA,GAAa,QAAQ,CAAA;AAAA,MAC3C,OAAA,EAAS,MAAM,KAAA,CAAM,UAAA,GAAa,OAAO,CAAA;AAAA,MACzC,OAAA,EAAS,MAAM,KAAA,CAAM,UAAA,GAAa,OAAO;AAAA,KAC1C,CAAA;AACD,IAAA,MAAA,CAAO,IAAA,EAAK;AACZ,IAAA,OAAO;AAAA,MACL,OAAA,GAAU;AACR,QAAA,MAAA,CAAO,OAAA,IAAU;AACjB,QAAA,KAAA,CAAM,aAAa,QAAQ,CAAA;AAAA,MAC7B;AAAA,KACF;AAAA,EACF;AACF,CAAC;AAED,eAAe,WAAA,GAAsC;AACnD,EAAA,IAAI;AACF,IAAA,OAAO,MAAM,OAAO,SAAS,CAAA;AAAA,EAC/B,CAAA,CAAA,MAAQ;AACN,IAAA,MAAM,IAAI,MAAM,oDAAoD,CAAA;AAAA,EACtE;AACF","file":"browser.js","sourcesContent":["/**\n * Browser launcher for Persona embedded inquiries.\n *\n * Dynamically imports optional peer `persona`. Browser callbacks are UX\n * signals only — they must not be treated as canonical verification decisions.\n * Documents stay at Persona; this plugin never receives document bytes.\n */\n\nexport const personaEmbeddedLauncherKey = 'persona_embedded' as const;\n\nexport interface PersonaBrowserLaunchInput {\n container?: HTMLElement;\n inquiryId?: string;\n transientSecret?: string;\n environment?: 'sandbox' | 'production';\n onUxSignal?: (signal: 'complete' | 'cancel' | 'error' | 'event') => void;\n}\n\nexport const personaBrowserPlugin = Object.freeze({\n launcherKey: personaEmbeddedLauncherKey,\n async launch(input: PersonaBrowserLaunchInput): Promise<{ unmount(): void }> {\n const persona = await loadPersona();\n const Client = persona.Client ?? persona.default?.Client;\n if (typeof Client !== 'function') {\n throw new Error('Persona browser SDK did not export Client.');\n }\n const client = new Client({\n inquiryId: input.inquiryId,\n sessionToken: input.transientSecret,\n environment: input.environment,\n onComplete: () => input.onUxSignal?.('complete'),\n onCancel: () => input.onUxSignal?.('cancel'),\n onError: () => input.onUxSignal?.('error'),\n onEvent: () => input.onUxSignal?.('event'),\n });\n client.open();\n return {\n unmount() {\n client.destroy?.();\n input.onUxSignal?.('cancel');\n },\n };\n },\n});\n\nasync function loadPersona(): Promise<PersonaModule> {\n try {\n return await import('persona') as PersonaModule;\n } catch {\n throw new Error('Optional peer dependency persona is not installed.');\n }\n}\n\ninterface PersonaClient {\n open(): void;\n destroy?: () => void;\n}\n\ninterface PersonaModule {\n Client?: new (options: Record<string, unknown>) => PersonaClient;\n default?: { Client?: new (options: Record<string, unknown>) => PersonaClient };\n}\n"]}