@flonkid/kyc 1.5.1 → 1.6.1

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 CHANGED
@@ -16,6 +16,17 @@ npm install @flonkid/kyc
16
16
  | `@flonkid/kyc` | Browser — widget + React component |
17
17
  | `@flonkid/kyc/server` | Node.js — sessions API + webhook verification |
18
18
 
19
+ ## Keys
20
+
21
+ You'll find two keys in **Dashboard → Project Settings → API Keys**:
22
+
23
+ | Key | Prefix | Where to use | Purpose |
24
+ |-----|--------|--------------|---------|
25
+ | **Publishable key** | `pk_live_*` / `pk_sandbox_*` | Frontend (browser) | Loads your project branding (logo, colors) instantly |
26
+ | **Secret key** | `sk_live_*` / `sk_sandbox_*` | Backend only | Creates sessions, authenticates API calls |
27
+
28
+ > **Never expose your secret key in client-side code.**
29
+
19
30
  ## React Component (recommended)
20
31
 
21
32
  ### Option A: SDK handles session creation
@@ -24,6 +35,7 @@ npm install @flonkid/kyc
24
35
  import { FlonkKYCWidget } from '@flonkid/kyc';
25
36
 
26
37
  <FlonkKYCWidget
38
+ publishableKey="pk_live_..."
27
39
  serverUrl="/api/kyc/create-session"
28
40
  clientMetadata={{ email: 'user@example.com', userId: 'user_123' }}
29
41
  lang="de"
@@ -34,6 +46,7 @@ import { FlonkKYCWidget } from '@flonkid/kyc';
34
46
 
35
47
  // With authenticated backend
36
48
  <FlonkKYCWidget
49
+ publishableKey="pk_live_..."
37
50
  serverUrl="/api/kyc/create-session"
38
51
  requestHeaders={{ Authorization: `Bearer ${token}` }}
39
52
  ...
@@ -66,6 +79,7 @@ const { sessionId, embedToken } = await fetch('/api/kyc/create-session', {
66
79
 
67
80
  | Prop | Type | Description |
68
81
  |------|------|-------------|
82
+ | `publishableKey` | `string` | Your `pk_live_*` key — enables instant branded loader |
69
83
  | `serverUrl` | `string` | Your backend endpoint — SDK auto-creates session |
70
84
  | `sessionId` | `string` | Pre-created session ID (Option B) |
71
85
  | `embedToken` | `string` | JWT token from your backend (Option B) |
@@ -86,6 +100,7 @@ import { FlonkKYC } from '@flonkid/kyc';
86
100
  const kyc = new FlonkKYC();
87
101
 
88
102
  const widget = await kyc.init({
103
+ publishableKey: 'pk_live_...',
89
104
  serverUrl: '/api/kyc/create-session',
90
105
  clientMetadata: { email: 'user@example.com' },
91
106
  lang: 'de',