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

# signTestToken

> Signs an install token a handler built against testJwks accepts.

```ts theme={null}
function signTestToken(claims?, options?): Promise<string>;
```

Signs an install token a handler built against `testJwks` accepts.

## Parameters

### claims?

`Partial`\<`TappifyClaims`> = `{}`

### options?

#### expiresIn?

`string`

#### extensionId?

`string`

## Returns

`Promise`\<`string`>

## Remarks

Every claim has a default — install `ins_test`, extension `starter`, project
`prj_north`, organization `org_test`, no scopes — and the audience is
`ext:<extensionId>`, taken from `options.extensionId`, then from the claims, then
`starter`. It expires in five minutes unless `expiresIn` says otherwise, which is
how a test covers an expired token. `createTestClient` and `createTapMock` sign
their own tokens, so reach for this only when a test verifies a token itself.

## Example

```ts theme={null}
import { verifyTappifyToken } from '@tappify/extension-sdk/server';
import { signTestToken, testJwks } from '@tappify/extension-sdk/testing';

async function claimsOfTestToken() {
  const token = await signTestToken({ scopes: ['analytics:read'] });
  return verifyTappifyToken(token, {
    extensionId: 'starter',
    jwks: await testJwks(),
  });
}
```
