> ## Documentation Index
> Fetch the complete documentation index at: https://stytch.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Session

> Update Session using the Stytch Vanilla JS SDK

Update a user's session tokens to hydrate a front-end session from the backend. For example, if you log your users in with one of our backend SDKs, you can pass the resulting `session_token` and `session_jwt` to this method to prime the frontend SDK with a valid set of tokens. You must then make an [authenticate](./authenticate-session) call to authenticate the session tokens and retrieve the user's current session.

## Parameters

<ParamField path="tokens" type="object">
  The session tokens to update the front-end session.

  <Expandable title="properties">
    <ParamField path="session_token" type="string">
      An opaque session token.
    </ParamField>

    <ParamField path="session_jwt" type="string">
      A JSON Web Token that contains standard claims about the user as well as information about the Stytch session.
    </ParamField>
  </Expandable>
</ParamField>

<Panel>
  <RequestExample>
    ```js theme={null}
    /* eslint @typescript-eslint/no-unused-vars: ["error", { "varsIgnorePattern": "^session$" }] */
    import { StytchClient } from '@stytch/vanilla-js';

    const stytch = new StytchClient('${publicToken}');

    export const authenticate = async () => {
    stytch.session.updateSession({
      session_token: 'a session token from your backend',
      session_jwt: 'a session JWT from your backend',
    });

    const session = await stytch.session.authenticate({ session_duration_minutes: 60 });
    };
    ```
  </RequestExample>
</Panel>
