# app.didpic.identity.mintWidgetToken

> Published by [lexicons.didpic.app](https://lexicon.garden/identity/did:plc:an2jtp4jgkkbtmwfzhpbxawd)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:an2jtp4jgkkbtmwfzhpbxawd/app.didpic.identity.mintWidgetToken)
- [Documentation](https://lexicon.garden/lexicon/did:plc:an2jtp4jgkkbtmwfzhpbxawd/app.didpic.identity.mintWidgetToken/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:an2jtp4jgkkbtmwfzhpbxawd/app.didpic.identity.mintWidgetToken/examples)

## Definitions

### `app.didpic.identity.mintWidgetToken`

**Type**: `procedure`

Mint a long-lived opaque bearer token bound to the authenticated viewer's DID, scoped to widget-readable methods only. The iOS home-screen widget uses this so it doesn't need to port DPoP signing into Swift. Returns the raw token (only shown once) plus its expiry. Tokens never expire any prior tokens — the old one keeps working until its own expiry.

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `token` | `string` | Yes | Opaque bearer token. Use as `Authorization: Bearer <token>` directly against the AppView for allowed methods. Always prefixed with `dpwt_`. |
| `expiresAt` | `string` (datetime) | Yes |  |

## Raw Schema

```json
{
  "id": "app.didpic.identity.mintWidgetToken",
  "defs": {
    "main": {
      "type": "procedure",
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "token",
            "expiresAt"
          ],
          "properties": {
            "token": {
              "type": "string",
              "description": "Opaque bearer token. Use as `Authorization: Bearer <token>` directly against the AppView for allowed methods. Always prefixed with `dpwt_`."
            },
            "expiresAt": {
              "type": "string",
              "format": "datetime"
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Mint a long-lived opaque bearer token bound to the authenticated viewer's DID, scoped to widget-readable methods only. The iOS home-screen widget uses this so it doesn't need to port DPoP signing into Swift. Returns the raw token (only shown once) plus its expiry. Tokens never expire any prior tokens — the old one keeps working until its own expiry."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
