@proveanything/smartlinks 1.13.19 → 1.13.20
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/docs/API_SUMMARY.md
CHANGED
|
@@ -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/docs/API_SUMMARY.md
CHANGED
|
@@ -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
|
---
|