Member Junction
    Preparing search index...

    Parameters for creating a push-notification subscription with a remote messaging service (e.g. Microsoft Graph change notifications).

    type CreateSubscriptionParams<T = Record<string, any>> = {
        ChangeTypes: SubscriptionChangeType[];
        ClientState: string;
        ContextData?: T;
        Identifier?: string;
        LifecycleNotificationUrl?: string;
        NotificationUrl: string;
        RequestedExpiration?: Date;
    }

    Type Parameters

    • T = Record<string, any>
    Index

    Properties

    ChangeTypes: SubscriptionChangeType[]

    Which changes to watch, e.g. ['created']. The provider validates these against what the remote service supports.

    ClientState: string

    Consumer-generated opaque secret the remote service echoes back in every notification (Graph clientState). The consumer uses it to authenticate inbound notifications. Providers pass it through; they do not store it.

    ContextData?: T

    Provider-specific extras (e.g. Graph: { folderName } or { folderId }; Gmail: Pub/Sub topic).

    Identifier?: string

    What to watch - same semantics as GetMessagesParams.Identifier: an email address/mailbox for email providers, a phone number for SMS, etc. Optional when the credential itself is scoped to one mailbox/number.

    LifecycleNotificationUrl?: string

    Optional secondary endpoint for lifecycle events (Graph lifecycleNotificationUrl - reauthorization required, subscription removed, etc.).

    NotificationUrl: string

    Public HTTPS endpoint the remote service will call when a matching change occurs.

    RequestedExpiration?: Date

    Requested expiration. Providers clamp to the service maximum (Graph mail: 4230 minutes). Ignored by services whose registrations don't expire.