Installation
Basic Usage
SDK Methods
The Siren TypeScript SDK provides a clean, namespaced interface to interact with the Siren API. Below are the available methods organized by functionality.Templates
Method | Description |
---|---|
client.template.get() | Retrieves a list of notification templates with optional filtering, sorting, and pagination |
client.template.create() | Creates a new notification template |
client.template.update() | Updates an existing notification template |
client.template.delete() | Deletes an existing notification template |
client.template.publish() | Publishes a template, making its latest draft version live |
Channel Templates
Method | Description |
---|---|
client.template.createChannelTemplate() | Creates or updates channel-specific templates (EMAIL, SMS, etc.) |
client.template.getChannelTemplates() | Retrieves channel templates for a specific template version |
Messaging
Method | Description |
---|---|
client.message.send() | Sends a message (with or without using a template) to a recipient via a chosen channel |
client.message.sendAwesomeTemplate() | Sends a message using a template path/identifier |
client.message.getReplies() | Retrieves replies for a specific message ID |
client.message.getStatus() | Retrieves the status of a specific message (SENT, DELIVERED, FAILED, etc.) |
Workflows
Method | Description |
---|---|
client.workflow.trigger() | Triggers a workflow with given data and notification payloads |
client.workflow.triggerBulk() | Triggers a workflow in bulk for multiple recipients |
client.workflow.schedule() | Schedules a workflow to run at a future time (once or recurring) |
Webhooks
Method | Description |
---|---|
client.webhook.configureNotifications() | Configures webhook URL for receiving status updates |
client.webhook.configureInbound() | Configures webhook URL for receiving inbound messages |
Users
Method | Description |
---|---|
client.user.add() | Creates a new user or updates existing user with given unique_id |
client.user.update() | Updates an existing user’s information |
client.user.delete() | Deletes an existing user |
For Package Developers
Environment Configuration
For testing the SDK, set these environment variables:SIREN_API_KEY
: Your API key from the Siren dashboardSIREN_ENV
: Set todev
for development/testing (defaults toprod
)
Prerequisites
- Git
- Node.js 14 or higher
- npm or yarn
Setup Steps
1
Clone the repository
2
Install dependencies
3
Set up pre-commit hooks
@trysiren/node
SDK!
Code Style & Linting
Code style is enforced by:- ESLint and Prettier for code formatting
- TypeScript compiler for type checking
Running Tests
To run the test suite, use the following command from the project root directory:src/__tests__/
directory.
Submitting Changes
- Create a feature branch for your changes
- Commit your changes (pre-commit hooks will run)
- Push your branch and open a Pull Request against the
develop
branch