@tinycloud/web-sdk 3.9.0-beta.6 → 3.9.0-beta.8
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 +23 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -46,6 +46,29 @@ const result = await storage.get('myKey');
|
|
|
46
46
|
console.log(result.data); // { hello: 'world' }
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
### Stored sessions and `signIn()`
|
|
50
|
+
|
|
51
|
+
`signIn()` first restores a stored session for the connected wallet when that
|
|
52
|
+
session covers every permission in the app's current manifest. If the app
|
|
53
|
+
changed its manifest (for example a new permission or prefix), the stored
|
|
54
|
+
session is cleared and the user is asked again, automatically. The check is
|
|
55
|
+
local: it reads the session's signed permissions (and any approved runtime
|
|
56
|
+
grants), and the default browser storage does not restore a session past its
|
|
57
|
+
expiry. It does not contact the node, so a session the node rejects (a 401
|
|
58
|
+
after a revocation or a reset, for example) is still restored. With OpenKey,
|
|
59
|
+
`prepareSignIn()` makes the same check.
|
|
60
|
+
|
|
61
|
+
To force a fresh consent, sign out first. `signOut()` clears the stored session
|
|
62
|
+
and blocks restoring until the next sign-in succeeds, so `signIn()` prompts:
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
await tc.signOut();
|
|
66
|
+
await tc.signIn();
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
There is no separate "fresh sign-in" option. Calling `restoreSession()` yourself
|
|
70
|
+
restores a stored session without the manifest check.
|
|
71
|
+
|
|
49
72
|
## Optional local KV replication
|
|
50
73
|
|
|
51
74
|
Install `@tinycloud/replica`, then load and register the optional browser plugin
|