@proveanything/smartlinks 1.13.19 → 1.14.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/dist/api/authKit.d.ts +3 -1
- package/dist/api/authKit.js +9 -1
- package/dist/docs/API_SUMMARY.md +5 -2
- package/dist/docs/portal-auth-broadcast.md +3 -27
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/openapi.yaml +27 -1
- package/docs/API_SUMMARY.md +5 -2
- package/docs/portal-auth-broadcast.md +3 -27
- package/openapi.yaml +27 -1
- package/package.json +1 -1
package/dist/api/authKit.d.ts
CHANGED
|
@@ -13,8 +13,10 @@ export declare namespace authKit {
|
|
|
13
13
|
displayName?: string;
|
|
14
14
|
accountData?: Record<string, any>;
|
|
15
15
|
}): Promise<AuthLoginResponse>;
|
|
16
|
-
/** Google OAuth login (public). */
|
|
16
|
+
/** Google OAuth login via ID token (public). */
|
|
17
17
|
function googleLogin(clientId: string, idToken: string): Promise<AuthLoginResponse>;
|
|
18
|
+
/** Google OAuth login via server-side authorization code (public). */
|
|
19
|
+
function googleCodeLogin(clientId: string, code: string, redirectUri: string): Promise<AuthLoginResponse>;
|
|
18
20
|
/** Send a magic link email to the user (public). */
|
|
19
21
|
function sendMagicLink(clientId: string, data: {
|
|
20
22
|
email: string;
|
package/dist/api/authKit.js
CHANGED
|
@@ -21,7 +21,7 @@ export var authKit;
|
|
|
21
21
|
return post(`/authkit/${encodeURIComponent(clientId)}/auth/register`, data);
|
|
22
22
|
}
|
|
23
23
|
authKit.register = register;
|
|
24
|
-
/** Google OAuth login (public). */
|
|
24
|
+
/** Google OAuth login via ID token (public). */
|
|
25
25
|
async function googleLogin(clientId, idToken) {
|
|
26
26
|
const res = await post(`/authkit/${encodeURIComponent(clientId)}/auth/google`, { idToken });
|
|
27
27
|
if (res.token)
|
|
@@ -29,6 +29,14 @@ export var authKit;
|
|
|
29
29
|
return res;
|
|
30
30
|
}
|
|
31
31
|
authKit.googleLogin = googleLogin;
|
|
32
|
+
/** Google OAuth login via server-side authorization code (public). */
|
|
33
|
+
async function googleCodeLogin(clientId, code, redirectUri) {
|
|
34
|
+
const res = await post(`/authkit/${encodeURIComponent(clientId)}/auth/google-code`, { code, redirectUri });
|
|
35
|
+
if (res.token)
|
|
36
|
+
setBearerToken(res.token);
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
39
|
+
authKit.googleCodeLogin = googleCodeLogin;
|
|
32
40
|
/** Send a magic link email to the user (public). */
|
|
33
41
|
async function sendMagicLink(clientId, data) {
|
|
34
42
|
return post(`/authkit/${encodeURIComponent(clientId)}/auth/magic-link/send`, data);
|
package/dist/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.14.0 | Generated: 2026-05-16T07:55:10.905Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -8227,7 +8227,10 @@ Login with email + password (public).
|
|
|
8227
8227
|
Register a new user (public).
|
|
8228
8228
|
|
|
8229
8229
|
**googleLogin**(clientId: string, idToken: string) → `Promise<AuthLoginResponse>`
|
|
8230
|
-
Google OAuth login (public).
|
|
8230
|
+
Google OAuth login via ID token (public).
|
|
8231
|
+
|
|
8232
|
+
**googleCodeLogin**(clientId: string, code: string, redirectUri: string) → `Promise<AuthLoginResponse>`
|
|
8233
|
+
Google OAuth login via server-side authorization code (public).
|
|
8231
8234
|
|
|
8232
8235
|
**sendMagicLink**(clientId: string, data: { email: string; redirectUrl: string; accountData?: Record<string, any> }) → `Promise<MagicLinkSendResponse>`
|
|
8233
8236
|
Send a magic link email to the user (public).
|
|
@@ -52,32 +52,8 @@ function BidButton() {
|
|
|
52
52
|
|
|
53
53
|
## Iframe Apps (Cross-Origin)
|
|
54
54
|
|
|
55
|
-
Iframe apps don't share React context.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
```ts
|
|
59
|
-
import { authKit } from '@proveanything/smartlinks';
|
|
60
|
-
|
|
61
|
-
// After your custom flow succeeds:
|
|
62
|
-
await authKit.publishLogin({
|
|
63
|
-
token, // string — your API's bearer token
|
|
64
|
-
user: { // mirrors AuthUser
|
|
65
|
-
uid: 'usr_123',
|
|
66
|
-
email: 'bidder@example.com',
|
|
67
|
-
displayName: 'Jane Bidder',
|
|
68
|
-
},
|
|
69
|
-
accountData: { tier: 'gold' }, // optional, free-form
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
// On sign-out:
|
|
73
|
-
await authKit.publishLogout();
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Raw postMessage (fallback)
|
|
77
|
-
|
|
78
|
-
If you can't use the helper (e.g. you're outside the SDK), post the raw
|
|
79
|
-
messages from the iframe to its parent. The portal's `IframeResponder`
|
|
80
|
-
listens for these:
|
|
55
|
+
Iframe apps don't share React context. Post messages directly from the
|
|
56
|
+
iframe to its parent — the portal's `IframeResponder` listens for these:
|
|
81
57
|
|
|
82
58
|
```ts
|
|
83
59
|
// LOGIN
|
|
@@ -138,7 +114,7 @@ through the standard portal UI.
|
|
|
138
114
|
wiped.
|
|
139
115
|
|
|
140
116
|
❌ Implementing logout by just clearing your own state. Always call
|
|
141
|
-
`useAuth().logout()` (container/widget) or `
|
|
117
|
+
`useAuth().logout()` (container/widget) or post `smartlinks:authkit:logout`
|
|
142
118
|
(iframe) so the whole portal session ends cleanly.
|
|
143
119
|
|
|
144
120
|
---
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { initializeApi, isInitialized, hasAuthCredentials, configureSdkCache, invalidateCache, request, sendCustomProxyMessage } from "./http";
|
|
1
|
+
export { initializeApi, isInitialized, hasAuthCredentials, configureSdkCache, invalidateCache, request, post, put, patch, del, sendCustomProxyMessage, getApiHeaders, isProxyEnabled } from "./http";
|
|
2
2
|
export * from "./api";
|
|
3
3
|
export * from "./types";
|
|
4
4
|
export { iframe } from "./iframe";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
// Top-level entrypoint of the npm package. Re-export initializeApi + all namespaces.
|
|
3
|
-
export { initializeApi, isInitialized, hasAuthCredentials, configureSdkCache, invalidateCache, request, sendCustomProxyMessage } from "./http";
|
|
3
|
+
export { initializeApi, isInitialized, hasAuthCredentials, configureSdkCache, invalidateCache, request, post, put, patch, del, sendCustomProxyMessage, getApiHeaders, isProxyEnabled } from "./http";
|
|
4
4
|
export * from "./api";
|
|
5
5
|
export * from "./types";
|
|
6
6
|
// Iframe namespace
|
package/dist/openapi.yaml
CHANGED
|
@@ -8100,7 +8100,7 @@ paths:
|
|
|
8100
8100
|
post:
|
|
8101
8101
|
tags:
|
|
8102
8102
|
- authKit
|
|
8103
|
-
summary: Google OAuth login (public).
|
|
8103
|
+
summary: Google OAuth login via ID token (public).
|
|
8104
8104
|
operationId: authKit_googleLogin
|
|
8105
8105
|
security: []
|
|
8106
8106
|
parameters:
|
|
@@ -8122,6 +8122,32 @@ paths:
|
|
|
8122
8122
|
description: Unauthorized
|
|
8123
8123
|
404:
|
|
8124
8124
|
description: Not found
|
|
8125
|
+
/authkit/{clientId}/auth/google-code:
|
|
8126
|
+
post:
|
|
8127
|
+
tags:
|
|
8128
|
+
- authKit
|
|
8129
|
+
summary: Google OAuth login via server-side authorization code (public).
|
|
8130
|
+
operationId: authKit_googleCodeLogin
|
|
8131
|
+
security: []
|
|
8132
|
+
parameters:
|
|
8133
|
+
- name: clientId
|
|
8134
|
+
in: path
|
|
8135
|
+
required: true
|
|
8136
|
+
schema:
|
|
8137
|
+
type: string
|
|
8138
|
+
responses:
|
|
8139
|
+
200:
|
|
8140
|
+
description: Success
|
|
8141
|
+
content:
|
|
8142
|
+
application/json:
|
|
8143
|
+
schema:
|
|
8144
|
+
$ref: "#/components/schemas/AuthLoginResponse"
|
|
8145
|
+
400:
|
|
8146
|
+
description: Bad request
|
|
8147
|
+
401:
|
|
8148
|
+
description: Unauthorized
|
|
8149
|
+
404:
|
|
8150
|
+
description: Not found
|
|
8125
8151
|
/authkit/{clientId}/auth/login:
|
|
8126
8152
|
post:
|
|
8127
8153
|
tags:
|
package/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.14.0 | Generated: 2026-05-16T07:55:10.905Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -8227,7 +8227,10 @@ Login with email + password (public).
|
|
|
8227
8227
|
Register a new user (public).
|
|
8228
8228
|
|
|
8229
8229
|
**googleLogin**(clientId: string, idToken: string) → `Promise<AuthLoginResponse>`
|
|
8230
|
-
Google OAuth login (public).
|
|
8230
|
+
Google OAuth login via ID token (public).
|
|
8231
|
+
|
|
8232
|
+
**googleCodeLogin**(clientId: string, code: string, redirectUri: string) → `Promise<AuthLoginResponse>`
|
|
8233
|
+
Google OAuth login via server-side authorization code (public).
|
|
8231
8234
|
|
|
8232
8235
|
**sendMagicLink**(clientId: string, data: { email: string; redirectUrl: string; accountData?: Record<string, any> }) → `Promise<MagicLinkSendResponse>`
|
|
8233
8236
|
Send a magic link email to the user (public).
|
|
@@ -52,32 +52,8 @@ function BidButton() {
|
|
|
52
52
|
|
|
53
53
|
## Iframe Apps (Cross-Origin)
|
|
54
54
|
|
|
55
|
-
Iframe apps don't share React context.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
```ts
|
|
59
|
-
import { authKit } from '@proveanything/smartlinks';
|
|
60
|
-
|
|
61
|
-
// After your custom flow succeeds:
|
|
62
|
-
await authKit.publishLogin({
|
|
63
|
-
token, // string — your API's bearer token
|
|
64
|
-
user: { // mirrors AuthUser
|
|
65
|
-
uid: 'usr_123',
|
|
66
|
-
email: 'bidder@example.com',
|
|
67
|
-
displayName: 'Jane Bidder',
|
|
68
|
-
},
|
|
69
|
-
accountData: { tier: 'gold' }, // optional, free-form
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
// On sign-out:
|
|
73
|
-
await authKit.publishLogout();
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Raw postMessage (fallback)
|
|
77
|
-
|
|
78
|
-
If you can't use the helper (e.g. you're outside the SDK), post the raw
|
|
79
|
-
messages from the iframe to its parent. The portal's `IframeResponder`
|
|
80
|
-
listens for these:
|
|
55
|
+
Iframe apps don't share React context. Post messages directly from the
|
|
56
|
+
iframe to its parent — the portal's `IframeResponder` listens for these:
|
|
81
57
|
|
|
82
58
|
```ts
|
|
83
59
|
// LOGIN
|
|
@@ -138,7 +114,7 @@ through the standard portal UI.
|
|
|
138
114
|
wiped.
|
|
139
115
|
|
|
140
116
|
❌ Implementing logout by just clearing your own state. Always call
|
|
141
|
-
`useAuth().logout()` (container/widget) or `
|
|
117
|
+
`useAuth().logout()` (container/widget) or post `smartlinks:authkit:logout`
|
|
142
118
|
(iframe) so the whole portal session ends cleanly.
|
|
143
119
|
|
|
144
120
|
---
|
package/openapi.yaml
CHANGED
|
@@ -8100,7 +8100,7 @@ paths:
|
|
|
8100
8100
|
post:
|
|
8101
8101
|
tags:
|
|
8102
8102
|
- authKit
|
|
8103
|
-
summary: Google OAuth login (public).
|
|
8103
|
+
summary: Google OAuth login via ID token (public).
|
|
8104
8104
|
operationId: authKit_googleLogin
|
|
8105
8105
|
security: []
|
|
8106
8106
|
parameters:
|
|
@@ -8122,6 +8122,32 @@ paths:
|
|
|
8122
8122
|
description: Unauthorized
|
|
8123
8123
|
404:
|
|
8124
8124
|
description: Not found
|
|
8125
|
+
/authkit/{clientId}/auth/google-code:
|
|
8126
|
+
post:
|
|
8127
|
+
tags:
|
|
8128
|
+
- authKit
|
|
8129
|
+
summary: Google OAuth login via server-side authorization code (public).
|
|
8130
|
+
operationId: authKit_googleCodeLogin
|
|
8131
|
+
security: []
|
|
8132
|
+
parameters:
|
|
8133
|
+
- name: clientId
|
|
8134
|
+
in: path
|
|
8135
|
+
required: true
|
|
8136
|
+
schema:
|
|
8137
|
+
type: string
|
|
8138
|
+
responses:
|
|
8139
|
+
200:
|
|
8140
|
+
description: Success
|
|
8141
|
+
content:
|
|
8142
|
+
application/json:
|
|
8143
|
+
schema:
|
|
8144
|
+
$ref: "#/components/schemas/AuthLoginResponse"
|
|
8145
|
+
400:
|
|
8146
|
+
description: Bad request
|
|
8147
|
+
401:
|
|
8148
|
+
description: Unauthorized
|
|
8149
|
+
404:
|
|
8150
|
+
description: Not found
|
|
8125
8151
|
/authkit/{clientId}/auth/login:
|
|
8126
8152
|
post:
|
|
8127
8153
|
tags:
|