Skip to content

Commit

Permalink
document useSession
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecAivazis committed Mar 7, 2024
1 parent 3d5e9b0 commit 3cdc871
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions site/src/routes/api/react/+page.svx
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,17 @@ const config = {
export default config
```

To access the current session, you can use the `useSession` hook:

```javascript
import { useSession } from '$houdini'

const [ session, setSession ] = useSession()
```

Calling `setSession` updates the client-side session as well as perists the new values in the application
cookie so that its available on the next load.

## Local APIs

For many applications, the API can live in the same codebase as the UI. When that happens, there
Expand Down

0 comments on commit 3cdc871

Please sign in to comment.