# Configuring the client (https://session-kit.pages.dev/docs/configuration)

The client from [Getting started](https://session-kit.pages.dev/docs/getting-started) sets a few
options and leaves the rest to their defaults. When your app outgrows them,
because your backend sends tokens differently, sessions must last longer, or
you need to see why a user was signed out, the options passed to
`createAuth` are where you change it.

This page lists every option, and the pages in this section explain each
part of the client in turn.

## Options

`createAuth` takes three required options and five optional ones:

| Option    | Required | What it sets                                                                                                                                        |
| --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`    | Yes      | Names the saved session and the refresh lock: letters, digits, `_` or `-`, up to 64 characters. Keeps two apps on one origin apart.                 |
| `user`    | Yes      | A [user schema](https://session-kit.pages.dev/docs/configuration/user-schemas), or [`fromAccessToken`](https://session-kit.pages.dev/docs/client/users-from-tokens).                                          |
| `storage` | Yes      | [Where the session is saved](https://session-kit.pages.dev/docs/configuration/storage).                                                                                          |
| `refresh` | No       | [How to get new tokens](https://session-kit.pages.dev/docs/configuration/refresh). Without it, the user is signed out when the access token expires or your API rejects it.      |
| `revoke`  | No       | [Revokes the ended tokens](https://session-kit.pages.dev/docs/client/signing-in-and-out) on your backend after a sign-out.                                                       |
| `maxAge`  | No       | [How long a saved session lasts](https://session-kit.pages.dev/docs/configuration/storage#how-long-a-saved-session-lasts), in seconds. Default: 30 days, counted from each save. |
| `debug`   | No       | [Reports what the client does](https://session-kit.pages.dev/docs/configuration/debugging). Default: off.                                                                        |
| `locking` | No       | [Restores a saved session as `locked`](https://session-kit.pages.dev/docs/client/locking), for native apps. Default: off.                                                        |

`createAuth` throws an `AuthError` with the code `INVALID_OPTIONS` when it
can't use an option, such as a `name` with other characters, or a `maxAge`
that isn't a positive whole number.

## Pages in this section

Each page covers one part of the client: how it checks users, gets new
tokens, saves the session, follows other tabs, and reports what happens.

- [User schemas](https://session-kit.pages.dev/docs/configuration/user-schemas): When the schema checks users, and what restoring a session asks of it.

- [Refresh](https://session-kit.pages.dev/docs/configuration/refresh): What the refresh callback returns, when a refresh runs, and what happens when it fails.

- [Expiry](https://session-kit.pages.dev/docs/configuration/expiry): How the client finds out when the access token expires.

- [Storage](https://session-kit.pages.dev/docs/configuration/storage): Where the session is saved, how long it lasts, and how to write your own store.

- [Tabs](https://session-kit.pages.dev/docs/configuration/tabs): How tabs follow each other's sign-ins, and take turns to refresh.

- [Errors](https://session-kit.pages.dev/docs/configuration/errors): Where errors appear, how to show them, and the failures that need a decision from you.

- [Debugging](https://session-kit.pages.dev/docs/configuration/debugging): Log what the client does, or send it to your error reporting.

## Next steps

- [Refresh](https://session-kit.pages.dev/docs/configuration/refresh): check that your refresh callback
  tells a rejected token from an outage.
- [Storage](https://session-kit.pages.dev/docs/configuration/storage): choose where the session is saved,
  and for how long.
- [Errors](https://session-kit.pages.dev/docs/configuration/errors): show failed refreshes and storage
  problems to your users.