# Admin sessions

> Prove who is looking at your app’s page in the admin.

Source: https://storeware.ai/docs/sdk/session

```ts
import { ... } from '@storeware/plugin-sdk';
```

### verifySession

Verifies a session token and returns its claims.

```ts
function verifySession(options: VerifySessionOptions): Promise<ExtensionSessionClaims>
```

### SessionVerificationError

```ts
new SessionVerificationError(reason: string)
```

### SessionContext

What the admin page around your extension had in context.

| Name | Type | Description |
| --- | --- | --- |
| `selection?` | `string[]` |  |

### ExtensionSessionClaims

| Name | Type | Description |
| --- | --- | --- |
| `iss` | `string` | Always https://storeware.ai. |
| `aud` | `string` | Your client id. |
| `sub` | `string` | The staff account viewing your extension. |
| `exp` | `number` |  |
| `iat` | `number` |  |
| `jti` | `string` |  |
| `sid` | `string` | The installation, so you know which merchant's access token to use. |
| `store_id` | `string` |  |
| `org_id` | `string` |  |
| `context` | `SessionContext` | What the surrounding page had in context, for example `\{ productId \}`. |

### VerifySessionOptions

| Name | Type | Description |
| --- | --- | --- |
| `token` | `string` |  |
| `secret` | `string` | The session_secret from your install response. |
| `clientId` | `string` | Your client id. A token minted for another app must not verify here. |
| `nowSeconds?` | `number` | Injectable for tests. |
