# PushSubscription

The PushSubscription type of the TypeScript SDK, which pushSubscriptions.create and pushSubscriptions.update take or answer.

```ts
type PushSubscription = {
  createdAt: number
  deviceClientId: string
  expires: number
  id: string
  types: string[] | null
  verified: boolean
}
```

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `createdAt` | `number` | Creation time in epoch seconds |
| `deviceClientId` | `string` | Client-chosen device identifier. Re-registering the same one replaces the previous subscription (and resets verification: new keys mean a new handshake) |
| `expires` | `number` | Expiry in epoch seconds, capped 30 days out. Extend with PATCH before it lapses; an expired subscription is invisible and the device re-registers |
| `id` | `string` | Subscription ULID |
| `types` | `string[]` \| `null` | Type names that wake this device, or null for all types |
| `verified` | `boolean` | False until the device echoes back the verificationCode delivered by the handshake push. Nothing is ever pushed to an unverified subscription |

## Used by

| Method | What it does |
| --- | --- |
| [`pushSubscriptions.create`](/docs/sdks/typescript/push-subscriptions/create) | Register a push subscription |
| [`pushSubscriptions.update`](/docs/sdks/typescript/push-subscriptions/update) | Verify or extend a push subscription |

## Used in

[`PushSubscriptionPage`](/docs/sdks/typescript/types/push-subscription-page).
