Amazon SNS is a fully managed messaging service for both system-to-system and app-to-person (A2P) communication.
This is a workspace where you can find AWS SDK for JavaScript version 3 (v3) Amazon SNS examples.
- Check phone opt out
- Confirm a subscription
- Create a topic
- Delete a topic
- Get SMS type
- Get topic attributes
- List opted out numbers
- List subscriptions
- List topics
- Publish SMS
- Publish to topics
- Set SMS type
- Set topic attributes
- Subscribe to an app
- Subscribe to an email
- Subscribe to Lambda
- Unscribe
Note: All code examples are written in ECMAscript 6 (ES6). For guidelines on converting to CommonJS, see JavaScript ES6/CommonJS syntax.
-
Clone the AWS SDK Code Samples repo to your local environment. See the Github documentation for instructions.
-
Install the dependencies listed in the package.json.
Note: These include the client module for the AWS services required in these example, which is "@aws-sdk/client-sns".
npm install node -g
cd javascriptv3/example_code/sns
npm install
-
In your text editor, update user variables specified in the
Inputssection of the sample file. -
Run sample code:
cd src
node [example name].js // For example, node sns_checkphoneoptout.js