prorm API Reference
    Preparing search index...

    Class SnsStore

    SnsStore wraps an AWS v3 SNSClient and exposes topic publishing, endpoint subscription registration, and topic administration.

    Implements

    Index
    name: "sns" = 'sns'

    The name of the store (e.g. 'mongodb', 'redis', 'dynamodb')

    library: "@aws-sdk/client-sns" = '@aws-sdk/client-sns'

    The client library being used

    • Publish — publish one message to the topic at topicArn. The message is encoded to a string (string as-is, Buffer → UTF-8, else JSON). Returns the message id (and FIFO sequence number, if any).

      Parameters

      • topicArn: string
      • message: SnsMessage
      • options: SnsPublishOptions = {}

      Returns Promise<SnsPublishResult>

    • CreateTopic — create a topic by name. Returns its ARN.

      Parameters

      • name: string
      • Optionalattributes: Record<string, string>

      Returns Promise<string | undefined>

    • Subscribe — register a push endpoint on the topic at topicArn. Unlike poll-based engines, SNS pushes notifications to the endpoint, so this takes an endpoint (SQS/Lambda ARN, HTTPS URL, email, ...) and a protocol rather than a message handler. Returns the subscription ARN (or 'pending confirmation' for endpoints that require confirmation).

      Parameters

      • topicArn: string
      • endpoint: string
      • options: SnsSubscribeOptions = {}

      Returns Promise<string | undefined>