## Usage

```
import { sdk } from '@farcaster/miniapp-sdk'

const { token } = await sdk.quickAuth.getToken()
```

See the [session token example](https://docs.neynar.com/miniapps/sdk/quick-auth#use-a-session-token-directly).

## Parameters

### force

- **Type:**`boolean`

Acquire a new token even if one is already in memory and not expired.

### quickAuthServerOrigin (optional)

- **Type:**`string`

Use a custom Quick Auth Server. Defaults to `https://auth.farcaster.xyz`.

## Return Value

A [JWT](https://datatracker.ietf.org/doc/html/rfc7519) issued by the Quick Auth Server based on the Sign In with Farcaster credential signed by the user.

```
{ token: string; }
```

You must [validate the token on your server](https://docs.neynar.com/miniapps/sdk/quick-auth#validate-a-session-token).

### JWT Payload

```
{
  "iat": 1747764819,
  "iss": "https://auth.farcaster.xyz",
  "exp": 1747768419,
  "sub": 6841,
  "aud": "miniapps.farcaster.xyz"
}
```

#### sub

- **Type:**`number`

The FID of the signed in user.

#### iss

- **Type:**`string`

The Quick Auth server that verified the SIWF credential and issued the JWT.

#### aud

- **Type:**`string`

The domain this token was issued to.

#### exp

- **Type:**`number`

The JWT expiration time.

#### iat

- **Type:**`number`

The JWT issued at time.
