# clerk_jwt_template (Resource)

A JWT template. A template defines the shape of the tokens that Clerk mints for a session, with custom claims and a custom lifetime.

## Example Usage

```terraform
resource "clerk_jwt_template" "api" {
  name     = "api"
  lifetime = 3600

  claims = jsonencode({
    role  = "{{user.public_metadata.role}}"
    email = "{{user.primary_email_address}}"
  })
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Template name. The name is the key that a frontend SDK uses with `getToken`.

### Optional

- `allowed_clock_skew` (Number) Allowed clock skew in seconds. The Clerk default is 5.
- `claims` (String) JSON object with the custom claims. Values support the Clerk shortcodes, for example `{{user.public_metadata.role}}`. Defaults to `{}`.
- `custom_signing_key` (Boolean) Set to `true` to sign tokens with your own key instead of the instance key.
- `lifetime` (Number) Token lifetime in seconds. The Clerk default is 60.
- `signing_algorithm` (String) Signing algorithm, for example `RS256` or `HS256`.
- `signing_key` (String, Sensitive) Private key for a custom signing key. Clerk never returns this value; the provider keeps the configured value in state and cannot detect server-side drift.

### Read-Only

- `id` (String) JWT template id.

## Import

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
terraform import clerk_jwt_template.api jtmp_2abcDEFghiJKLmnoPQRstuVWXyz
```