Skip to Content

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

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

Fields

FieldTypeDescription
createdAtnumberCreation time in epoch seconds
deviceClientIdstringClient-chosen device identifier. Re-registering the same one replaces the previous subscription (and resets verification: new keys mean a new handshake)
expiresnumberExpiry in epoch seconds, capped 30 days out. Extend with PATCH before it lapses; an expired subscription is invisible and the device re-registers
idstringSubscription ULID
typesstring[] | nullType names that wake this device, or null for all types
verifiedbooleanFalse until the device echoes back the verificationCode delivered by the handshake push. Nothing is ever pushed to an unverified subscription

Used by

MethodWhat it does
pushSubscriptions.createRegister a push subscription
pushSubscriptions.updateVerify or extend a push subscription

Used in

PushSubscriptionPage.