Skip to content

Commit

Permalink
session docs fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
wernst committed Jan 8, 2025
1 parent daba239 commit c623d7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/docs/src/pages/client/sessions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ const client = new TriplitClient({
serverUrl: 'https://<project-id>.triplit.io',
token: 'your-token',
});

// when ready to end session
await client.endSession();
// If signing out, it is recommended to also clear your local database
await client.clear();
```

<Callout>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/pages/client/storage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ async function clearCache() {
}
```

If you are clearing your cache because a user is signing out, it is recommended to use `client.reset()` as explained in the [auth guide](/auth#changing-users).
If you are clearing your cache because a user is signing out, it is recommended to use this in conjuction with `client.endSession()` as explained in the [auth guide](/auth#modeling-sign-in-and-sign-out-flows).

0 comments on commit c623d7e

Please sign in to comment.