@proveanything/smartlinks 1.13.15 → 1.13.16
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/dist/api/authKit.d.ts +1 -1
- package/dist/api/authKit.js +1 -1
- package/dist/docs/API_SUMMARY.md +17 -2
- package/dist/docs/auth-kit.md +18 -1
- package/dist/openapi.yaml +24 -1
- package/dist/types/authKit.d.ts +11 -0
- package/docs/API_SUMMARY.md +17 -2
- package/docs/auth-kit.md +18 -1
- package/openapi.yaml +24 -1
- package/package.json +1 -1
package/dist/api/authKit.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare namespace authKit {
|
|
|
29
29
|
function verifyPhoneCode(clientId: string, phoneNumber: string, code: string): Promise<PhoneVerifyResponse>;
|
|
30
30
|
/** Send a WhatsApp verification deep-link (public). */
|
|
31
31
|
function sendWhatsApp(clientId: string, body?: SendWhatsAppRequest): Promise<SendWhatsAppResponse>;
|
|
32
|
-
/** Manually verify WhatsApp token if inbound webhook path is unavailable (public). */
|
|
32
|
+
/** Manually verify WhatsApp token if inbound webhook path is unavailable (legacy/public fallback). */
|
|
33
33
|
function verifyWhatsApp(clientId: string, token: string, phoneNumber: string): Promise<VerifyWhatsAppResponse>;
|
|
34
34
|
/** Poll WhatsApp verification status for a token (public). */
|
|
35
35
|
function getWhatsAppStatus(clientId: string, token: string): Promise<WhatsAppStatusResponse>;
|
package/dist/api/authKit.js
CHANGED
|
@@ -51,7 +51,7 @@ export var authKit;
|
|
|
51
51
|
return post(`/authkit/${encodeURIComponent(clientId)}/auth/whatsapp/send`, body);
|
|
52
52
|
}
|
|
53
53
|
authKit.sendWhatsApp = sendWhatsApp;
|
|
54
|
-
/** Manually verify WhatsApp token if inbound webhook path is unavailable (public). */
|
|
54
|
+
/** Manually verify WhatsApp token if inbound webhook path is unavailable (legacy/public fallback). */
|
|
55
55
|
async function verifyWhatsApp(clientId, token, phoneNumber) {
|
|
56
56
|
return post(`/authkit/${encodeURIComponent(clientId)}/auth/whatsapp/verify`, { token, phoneNumber });
|
|
57
57
|
}
|
package/dist/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.13.
|
|
3
|
+
Version: 1.13.16 | Generated: 2026-05-15T19:36:34.712Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -3043,12 +3043,27 @@ interface WhatsAppReplyOptions {
|
|
|
3043
3043
|
}
|
|
3044
3044
|
```
|
|
3045
3045
|
|
|
3046
|
+
**WhatsAppContactData** (interface)
|
|
3047
|
+
```typescript
|
|
3048
|
+
interface WhatsAppContactData {
|
|
3049
|
+
name?: string
|
|
3050
|
+
firstName?: string
|
|
3051
|
+
lastName?: string
|
|
3052
|
+
displayName?: string
|
|
3053
|
+
email?: string
|
|
3054
|
+
source?: string
|
|
3055
|
+
customFields?: Record<string, unknown>
|
|
3056
|
+
externalIds?: Record<string, unknown>
|
|
3057
|
+
}
|
|
3058
|
+
```
|
|
3059
|
+
|
|
3046
3060
|
**SendWhatsAppRequest** (interface)
|
|
3047
3061
|
```typescript
|
|
3048
3062
|
interface SendWhatsAppRequest {
|
|
3049
3063
|
redirectUrl?: string
|
|
3050
3064
|
prefillMessage?: string
|
|
3051
3065
|
reply?: WhatsAppReplyOptions
|
|
3066
|
+
contactData?: WhatsAppContactData
|
|
3052
3067
|
}
|
|
3053
3068
|
```
|
|
3054
3069
|
|
|
@@ -8229,7 +8244,7 @@ Verify phone verification code (public).
|
|
|
8229
8244
|
Send a WhatsApp verification deep-link (public).
|
|
8230
8245
|
|
|
8231
8246
|
**verifyWhatsApp**(clientId: string, token: string, phoneNumber: string) → `Promise<VerifyWhatsAppResponse>`
|
|
8232
|
-
Manually verify WhatsApp token if inbound webhook path is unavailable (public).
|
|
8247
|
+
Manually verify WhatsApp token if inbound webhook path is unavailable (legacy/public fallback).
|
|
8233
8248
|
|
|
8234
8249
|
**getWhatsAppStatus**(clientId: string, token: string) → `Promise<WhatsAppStatusResponse>`
|
|
8235
8250
|
Poll WhatsApp verification status for a token (public).
|
package/dist/docs/auth-kit.md
CHANGED
|
@@ -82,6 +82,8 @@ const session = await authKit.verifyPhoneCode(clientId, '+61400000000', '123456'
|
|
|
82
82
|
|
|
83
83
|
Use these flows when you want low-friction verification before or without full account sign-in.
|
|
84
84
|
|
|
85
|
+
WhatsApp verification is token-first. The user does not type their phone number in your app for this flow; phone ownership is proven by the inbound WhatsApp sender number.
|
|
86
|
+
|
|
85
87
|
```ts
|
|
86
88
|
import { authKit } from '@proveanything/smartlinks';
|
|
87
89
|
|
|
@@ -92,6 +94,12 @@ const wa = await authKit.sendWhatsApp(clientId);
|
|
|
92
94
|
// const wa = await authKit.sendWhatsApp(clientId, {
|
|
93
95
|
// redirectUrl: 'https://app.example.com/checkout/continue',
|
|
94
96
|
// prefillMessage: 'Please let me bid in this auction. Code: {{token}}',
|
|
97
|
+
// contactData: {
|
|
98
|
+
// name: 'Jane Doe',
|
|
99
|
+
// email: 'jane@example.com',
|
|
100
|
+
// source: 'auction-checkout',
|
|
101
|
+
// customFields: { agreedToTerms: true },
|
|
102
|
+
// },
|
|
95
103
|
// reply: {
|
|
96
104
|
// cta: {
|
|
97
105
|
// body: "You're verified and ready to bid.",
|
|
@@ -112,7 +120,7 @@ if (status.status === 'verified' && wa.sessionKey) {
|
|
|
112
120
|
// session.token can be used as the authenticated bearer token
|
|
113
121
|
}
|
|
114
122
|
|
|
115
|
-
// Optional fallback path if webhook confirmation is unavailable
|
|
123
|
+
// Optional legacy fallback path if webhook confirmation is unavailable
|
|
116
124
|
await authKit.verifyWhatsApp(clientId, wa.token, '+447911123456');
|
|
117
125
|
|
|
118
126
|
// 2) Or send SMS click-to-verify link
|
|
@@ -126,6 +134,13 @@ await authKit.sendSmsVerify(clientId, {
|
|
|
126
134
|
await authKit.verifySms(clientId, '<token>', '+447911123456');
|
|
127
135
|
```
|
|
128
136
|
|
|
137
|
+
`contactData` is optional and is useful when you collect name/email before the customer switches to WhatsApp.
|
|
138
|
+
|
|
139
|
+
- Auth Kit stores `contactData` on the verification token metadata first.
|
|
140
|
+
- Contact details are written to durable contact storage only after WhatsApp verification succeeds.
|
|
141
|
+
- If the user abandons before verification, no contact is created.
|
|
142
|
+
- `contactData` must not include phone; the verified inbound WhatsApp sender number is always authoritative.
|
|
143
|
+
|
|
129
144
|
### Contact bootstrap / durable identity
|
|
130
145
|
|
|
131
146
|
After verification, upsert contact identity and store `contactId` on downstream records (raffle ticket, bid, claim intent).
|
|
@@ -183,6 +198,8 @@ const session = await authKit.exchangeWhatsAppSession(clientId, wa.token, wa.ses
|
|
|
183
198
|
`sessionKey` is returned by `sendWhatsApp` and is used to mitigate token replay from contexts that did not initiate the browser flow.
|
|
184
199
|
|
|
185
200
|
> **Note:** `redirectUrl` is optional. WhatsApp tokens are short hex strings (16 chars) for better UX.
|
|
201
|
+
>
|
|
202
|
+
> **Legacy note:** `verifyWhatsApp` is for older phone-bound token flows. Prefer inbound WhatsApp token confirmation plus status polling for new implementations.
|
|
186
203
|
|
|
187
204
|
### Google OAuth
|
|
188
205
|
|
package/dist/openapi.yaml
CHANGED
|
@@ -8589,7 +8589,7 @@ paths:
|
|
|
8589
8589
|
post:
|
|
8590
8590
|
tags:
|
|
8591
8591
|
- authKit
|
|
8592
|
-
summary: Manually verify WhatsApp token if inbound webhook path is unavailable (public).
|
|
8592
|
+
summary: Manually verify WhatsApp token if inbound webhook path is unavailable (legacy/public fallback).
|
|
8593
8593
|
operationId: authKit_verifyWhatsApp
|
|
8594
8594
|
security: []
|
|
8595
8595
|
parameters:
|
|
@@ -17915,6 +17915,27 @@ components:
|
|
|
17915
17915
|
$ref: "#/components/schemas/WhatsAppReplyCta"
|
|
17916
17916
|
text:
|
|
17917
17917
|
type: string
|
|
17918
|
+
WhatsAppContactData:
|
|
17919
|
+
type: object
|
|
17920
|
+
properties:
|
|
17921
|
+
name:
|
|
17922
|
+
type: string
|
|
17923
|
+
firstName:
|
|
17924
|
+
type: string
|
|
17925
|
+
lastName:
|
|
17926
|
+
type: string
|
|
17927
|
+
displayName:
|
|
17928
|
+
type: string
|
|
17929
|
+
email:
|
|
17930
|
+
type: string
|
|
17931
|
+
source:
|
|
17932
|
+
type: string
|
|
17933
|
+
customFields:
|
|
17934
|
+
type: object
|
|
17935
|
+
additionalProperties: true
|
|
17936
|
+
externalIds:
|
|
17937
|
+
type: object
|
|
17938
|
+
additionalProperties: true
|
|
17918
17939
|
SendWhatsAppRequest:
|
|
17919
17940
|
type: object
|
|
17920
17941
|
properties:
|
|
@@ -17924,6 +17945,8 @@ components:
|
|
|
17924
17945
|
type: string
|
|
17925
17946
|
reply:
|
|
17926
17947
|
$ref: "#/components/schemas/WhatsAppReplyOptions"
|
|
17948
|
+
contactData:
|
|
17949
|
+
$ref: "#/components/schemas/WhatsAppContactData"
|
|
17927
17950
|
SendWhatsAppResponse:
|
|
17928
17951
|
type: object
|
|
17929
17952
|
properties:
|
package/dist/types/authKit.d.ts
CHANGED
|
@@ -90,10 +90,21 @@ export interface WhatsAppReplyOptions {
|
|
|
90
90
|
/** Option C: plain-text fallback */
|
|
91
91
|
text?: string;
|
|
92
92
|
}
|
|
93
|
+
export interface WhatsAppContactData {
|
|
94
|
+
name?: string;
|
|
95
|
+
firstName?: string;
|
|
96
|
+
lastName?: string;
|
|
97
|
+
displayName?: string;
|
|
98
|
+
email?: string;
|
|
99
|
+
source?: string;
|
|
100
|
+
customFields?: Record<string, unknown>;
|
|
101
|
+
externalIds?: Record<string, unknown>;
|
|
102
|
+
}
|
|
93
103
|
export interface SendWhatsAppRequest {
|
|
94
104
|
redirectUrl?: string;
|
|
95
105
|
prefillMessage?: string;
|
|
96
106
|
reply?: WhatsAppReplyOptions;
|
|
107
|
+
contactData?: WhatsAppContactData;
|
|
97
108
|
}
|
|
98
109
|
export interface SendWhatsAppResponse {
|
|
99
110
|
waLink: string;
|
package/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.13.
|
|
3
|
+
Version: 1.13.16 | Generated: 2026-05-15T19:36:34.712Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -3043,12 +3043,27 @@ interface WhatsAppReplyOptions {
|
|
|
3043
3043
|
}
|
|
3044
3044
|
```
|
|
3045
3045
|
|
|
3046
|
+
**WhatsAppContactData** (interface)
|
|
3047
|
+
```typescript
|
|
3048
|
+
interface WhatsAppContactData {
|
|
3049
|
+
name?: string
|
|
3050
|
+
firstName?: string
|
|
3051
|
+
lastName?: string
|
|
3052
|
+
displayName?: string
|
|
3053
|
+
email?: string
|
|
3054
|
+
source?: string
|
|
3055
|
+
customFields?: Record<string, unknown>
|
|
3056
|
+
externalIds?: Record<string, unknown>
|
|
3057
|
+
}
|
|
3058
|
+
```
|
|
3059
|
+
|
|
3046
3060
|
**SendWhatsAppRequest** (interface)
|
|
3047
3061
|
```typescript
|
|
3048
3062
|
interface SendWhatsAppRequest {
|
|
3049
3063
|
redirectUrl?: string
|
|
3050
3064
|
prefillMessage?: string
|
|
3051
3065
|
reply?: WhatsAppReplyOptions
|
|
3066
|
+
contactData?: WhatsAppContactData
|
|
3052
3067
|
}
|
|
3053
3068
|
```
|
|
3054
3069
|
|
|
@@ -8229,7 +8244,7 @@ Verify phone verification code (public).
|
|
|
8229
8244
|
Send a WhatsApp verification deep-link (public).
|
|
8230
8245
|
|
|
8231
8246
|
**verifyWhatsApp**(clientId: string, token: string, phoneNumber: string) → `Promise<VerifyWhatsAppResponse>`
|
|
8232
|
-
Manually verify WhatsApp token if inbound webhook path is unavailable (public).
|
|
8247
|
+
Manually verify WhatsApp token if inbound webhook path is unavailable (legacy/public fallback).
|
|
8233
8248
|
|
|
8234
8249
|
**getWhatsAppStatus**(clientId: string, token: string) → `Promise<WhatsAppStatusResponse>`
|
|
8235
8250
|
Poll WhatsApp verification status for a token (public).
|
package/docs/auth-kit.md
CHANGED
|
@@ -82,6 +82,8 @@ const session = await authKit.verifyPhoneCode(clientId, '+61400000000', '123456'
|
|
|
82
82
|
|
|
83
83
|
Use these flows when you want low-friction verification before or without full account sign-in.
|
|
84
84
|
|
|
85
|
+
WhatsApp verification is token-first. The user does not type their phone number in your app for this flow; phone ownership is proven by the inbound WhatsApp sender number.
|
|
86
|
+
|
|
85
87
|
```ts
|
|
86
88
|
import { authKit } from '@proveanything/smartlinks';
|
|
87
89
|
|
|
@@ -92,6 +94,12 @@ const wa = await authKit.sendWhatsApp(clientId);
|
|
|
92
94
|
// const wa = await authKit.sendWhatsApp(clientId, {
|
|
93
95
|
// redirectUrl: 'https://app.example.com/checkout/continue',
|
|
94
96
|
// prefillMessage: 'Please let me bid in this auction. Code: {{token}}',
|
|
97
|
+
// contactData: {
|
|
98
|
+
// name: 'Jane Doe',
|
|
99
|
+
// email: 'jane@example.com',
|
|
100
|
+
// source: 'auction-checkout',
|
|
101
|
+
// customFields: { agreedToTerms: true },
|
|
102
|
+
// },
|
|
95
103
|
// reply: {
|
|
96
104
|
// cta: {
|
|
97
105
|
// body: "You're verified and ready to bid.",
|
|
@@ -112,7 +120,7 @@ if (status.status === 'verified' && wa.sessionKey) {
|
|
|
112
120
|
// session.token can be used as the authenticated bearer token
|
|
113
121
|
}
|
|
114
122
|
|
|
115
|
-
// Optional fallback path if webhook confirmation is unavailable
|
|
123
|
+
// Optional legacy fallback path if webhook confirmation is unavailable
|
|
116
124
|
await authKit.verifyWhatsApp(clientId, wa.token, '+447911123456');
|
|
117
125
|
|
|
118
126
|
// 2) Or send SMS click-to-verify link
|
|
@@ -126,6 +134,13 @@ await authKit.sendSmsVerify(clientId, {
|
|
|
126
134
|
await authKit.verifySms(clientId, '<token>', '+447911123456');
|
|
127
135
|
```
|
|
128
136
|
|
|
137
|
+
`contactData` is optional and is useful when you collect name/email before the customer switches to WhatsApp.
|
|
138
|
+
|
|
139
|
+
- Auth Kit stores `contactData` on the verification token metadata first.
|
|
140
|
+
- Contact details are written to durable contact storage only after WhatsApp verification succeeds.
|
|
141
|
+
- If the user abandons before verification, no contact is created.
|
|
142
|
+
- `contactData` must not include phone; the verified inbound WhatsApp sender number is always authoritative.
|
|
143
|
+
|
|
129
144
|
### Contact bootstrap / durable identity
|
|
130
145
|
|
|
131
146
|
After verification, upsert contact identity and store `contactId` on downstream records (raffle ticket, bid, claim intent).
|
|
@@ -183,6 +198,8 @@ const session = await authKit.exchangeWhatsAppSession(clientId, wa.token, wa.ses
|
|
|
183
198
|
`sessionKey` is returned by `sendWhatsApp` and is used to mitigate token replay from contexts that did not initiate the browser flow.
|
|
184
199
|
|
|
185
200
|
> **Note:** `redirectUrl` is optional. WhatsApp tokens are short hex strings (16 chars) for better UX.
|
|
201
|
+
>
|
|
202
|
+
> **Legacy note:** `verifyWhatsApp` is for older phone-bound token flows. Prefer inbound WhatsApp token confirmation plus status polling for new implementations.
|
|
186
203
|
|
|
187
204
|
### Google OAuth
|
|
188
205
|
|
package/openapi.yaml
CHANGED
|
@@ -8589,7 +8589,7 @@ paths:
|
|
|
8589
8589
|
post:
|
|
8590
8590
|
tags:
|
|
8591
8591
|
- authKit
|
|
8592
|
-
summary: Manually verify WhatsApp token if inbound webhook path is unavailable (public).
|
|
8592
|
+
summary: Manually verify WhatsApp token if inbound webhook path is unavailable (legacy/public fallback).
|
|
8593
8593
|
operationId: authKit_verifyWhatsApp
|
|
8594
8594
|
security: []
|
|
8595
8595
|
parameters:
|
|
@@ -17915,6 +17915,27 @@ components:
|
|
|
17915
17915
|
$ref: "#/components/schemas/WhatsAppReplyCta"
|
|
17916
17916
|
text:
|
|
17917
17917
|
type: string
|
|
17918
|
+
WhatsAppContactData:
|
|
17919
|
+
type: object
|
|
17920
|
+
properties:
|
|
17921
|
+
name:
|
|
17922
|
+
type: string
|
|
17923
|
+
firstName:
|
|
17924
|
+
type: string
|
|
17925
|
+
lastName:
|
|
17926
|
+
type: string
|
|
17927
|
+
displayName:
|
|
17928
|
+
type: string
|
|
17929
|
+
email:
|
|
17930
|
+
type: string
|
|
17931
|
+
source:
|
|
17932
|
+
type: string
|
|
17933
|
+
customFields:
|
|
17934
|
+
type: object
|
|
17935
|
+
additionalProperties: true
|
|
17936
|
+
externalIds:
|
|
17937
|
+
type: object
|
|
17938
|
+
additionalProperties: true
|
|
17918
17939
|
SendWhatsAppRequest:
|
|
17919
17940
|
type: object
|
|
17920
17941
|
properties:
|
|
@@ -17924,6 +17945,8 @@ components:
|
|
|
17924
17945
|
type: string
|
|
17925
17946
|
reply:
|
|
17926
17947
|
$ref: "#/components/schemas/WhatsAppReplyOptions"
|
|
17948
|
+
contactData:
|
|
17949
|
+
$ref: "#/components/schemas/WhatsAppContactData"
|
|
17927
17950
|
SendWhatsAppResponse:
|
|
17928
17951
|
type: object
|
|
17929
17952
|
properties:
|