@dcl/sns-component
v3.0.2
Published
AWS SNS component for core components library
Downloads
460
Readme
@dcl/sns-component
AWS SNS component for publishing messages to Amazon Simple Notification Service.
Installation
npm install @dcl/sns-componentUsage
import { createSnsComponent } from '@dcl/sns-component'
const snsPublisher = await createSnsComponent({ config })
await snsPublisher.publishMessage(event) // Single message
await snsPublisher.publishMessages([event1, event2]) // Batch of messagesConfiguration
The component requires the following environment variables:
AWS_SNS_ARN: The ARN of the SNS topicAWS_SNS_ENDPOINT(optional): Custom SNS endpoint for testing
Features
- Single message publishing
- Batch message publishing (up to 10 messages per batch)
- Automatic retry handling
- Type-safe message attributes
- Error reporting for failed messages
License
MIT
