{"id":30208348,"url":"https://github.com/keyvaluesoftwaresystems/siren-ts-sdk","last_synced_at":"2025-08-26T20:18:15.829Z","repository":{"id":308230861,"uuid":"984037738","full_name":"KeyValueSoftwareSystems/siren-ts-sdk","owner":"KeyValueSoftwareSystems","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-03T11:16:55.000Z","size":110,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-13T17:45:55.773Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KeyValueSoftwareSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-15T09:51:01.000Z","updated_at":"2025-07-31T09:10:16.000Z","dependencies_parsed_at":"2025-08-04T22:31:49.381Z","dependency_job_id":"4b35d466-5af0-44ad-858e-2e692802a0e6","html_url":"https://github.com/KeyValueSoftwareSystems/siren-ts-sdk","commit_stats":null,"previous_names":["keyvaluesoftwaresystems/siren-ts-sdk"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/KeyValueSoftwareSystems/siren-ts-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeyValueSoftwareSystems%2Fsiren-ts-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeyValueSoftwareSystems%2Fsiren-ts-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeyValueSoftwareSystems%2Fsiren-ts-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeyValueSoftwareSystems%2Fsiren-ts-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KeyValueSoftwareSystems","download_url":"https://codeload.github.com/KeyValueSoftwareSystems/siren-ts-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeyValueSoftwareSystems%2Fsiren-ts-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272253382,"owners_count":24900893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-13T17:24:47.340Z","updated_at":"2025-08-26T20:18:15.816Z","avatar_url":"https://github.com/KeyValueSoftwareSystems.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Siren TypeScript SDK\n\nThis is the official TypeScript SDK for the [Siren notification platform](https://docs.trysiren.io).\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Basic Usage](#basic-usage)\n- [SDK Methods](#sdk-methods)\n- [Examples](#examples)\n- [For Package Developers](#for-package-developers)\n\n## Installation\n\n```bash\nnpm install @trysiren/node\n# or\nyarn add @trysiren/node\n```\n\n## Basic Usage\n\n```typescript\nimport { SirenClient, ProviderCode, RecipientChannel } from '@trysiren/node';\n\n// Initialize using environment variables SIREN_API_KEY (and optional SIREN_ENV)\nconst client = new SirenClient();\n\n// --- Send a direct message (no template) ---\nconst directMessageId = await client.message.send({\n  recipientValue: 'alice@company.com',\n  channel: RecipientChannel.EMAIL,\n  body: 'Your account has been successfully verified. You can now access all features.'\n});\nconsole.log('Sent direct message:', directMessageId);\n\n// --- Send a message using a template ---\nconst templatedMessageId = await client.message.send({\n  recipientValue: 'U01UBCD06BB',\n  channel: RecipientChannel.SLACK,\n  templateName: 'welcome_template',\n  templateVariables: { user_name: 'John' }\n});\nconsole.log('Sent template message:', templatedMessageId);\n\n// --- Send with a specific provider ---\nconst providerMessageId = await client.message.send({\n  recipientValue: 'alice@company.com',\n  channel: RecipientChannel.EMAIL,\n  body: 'Your account has been successfully verified.',\n  providerName: 'email-provider',\n  providerCode: ProviderCode.EMAIL_SENDGRID\n});\nconsole.log('Sent with provider:', providerMessageId);\n\n// --- Send using an awesome template identifier ---\nconst awesomeMessageId = await client.message.sendAwesomeTemplate({\n  recipientValue: 'U01UBCD06BB',\n  channel: RecipientChannel.SLACK,\n  templateIdentifier:\n    'awesome-templates/customer-support/escalation_required/official/casual.yaml',\n  templateVariables: {\n    ticket_id: '123456',\n    customer_name: 'John',\n    issue_summary: 'Payment processing issue',\n    ticket_url: 'https://support.company.com/ticket/123456',\n    sender_name: 'Support Team'\n  },\n  providerName: 'slack-provider',\n  providerCode: ProviderCode.SLACK\n});\nconsole.log('Sent awesome template:', awesomeMessageId);\n```\n\n## SDK Methods\n\nThe Siren TypeScript SDK provides a clean, namespaced interface to interact with the Siren API.\n\n**Templates** (`client.template.*`)\n\n- **`client.template.get()`** - Retrieves a list of notification templates with optional filtering, sorting, and pagination\n- **`client.template.create()`** - Creates a new notification template\n- **`client.template.update()`** - Updates an existing notification template\n- **`client.template.delete()`** - Deletes an existing notification template\n- **`client.template.publish()`** - Publishes a template, making its latest draft version live\n\n**Channel Templates** (`client.template.*`)\n\n- **`client.template.createChannelTemplate()`** - Creates or updates channel-specific templates (EMAIL, SMS, etc.)\n- **`client.template.getChannelTemplates()`** - Retrieves channel templates for a specific template version\n\n**Messaging** (`client.message.*`)\n\n- **`client.message.send()`** - Sends a message (with or without using a template) to a recipient via a chosen channel\n- **`client.message.send_awesome_template()`** - Sends a message using a template path/identifier\n- **`client.message.getReplies()`** - Retrieves replies for a specific message ID\n- **`client.message.getStatus()`** - Retrieves the status of a specific message (SENT, DELIVERED, FAILED, etc.)\n\n**Workflows** (`client.workflow.*`)\n\n- **`client.workflow.trigger()`** - Triggers a workflow with given data and notification payloads\n- **`client.workflow.triggerBulk()`** - Triggers a workflow in bulk for multiple recipients\n- **`client.workflow.schedule()`** - Schedules a workflow to run at a future time (once or recurring)\n\n**Webhooks** (`client.webhook.*`)\n\n- **`client.webhook.configureNotifications()`** - Configures webhook URL for receiving status updates\n- **`client.webhook.configureInbound()`** - Configures webhook URL for receiving inbound messages\n\n**Users** (`client.user.*`)\n\n- **`client.user.add()`** - Creates a new user or updates existing user with given unique_id\n- **`client.user.update()`** - Updates an existing user's information\n- **`client.user.delete()`** - Deletes an existing user\n\n## Examples\n\nFor detailed usage examples of all SDK methods, see the [examples](./examples/) folder.\n\n## For Package Developers\n\n### Environment Configuration\n\nFor testing the SDK, set these environment variables:\n\n- **`SIREN_API_KEY`**: Your API key from the Siren dashboard\n- **`SIREN_ENV`**: Set to `dev` for development/testing (defaults to `prod`)\n\n### Prerequisites\n\n- Git\n- Node.js 14 or higher\n- npm or yarn\n\n### Setup Steps\n\n1.  **Clone the repository:**\n\n    ```bash\n    git clone https://github.com/KeyValueSoftwareSystems/siren-ts-sdk.git\n    cd siren-ts-sdk\n    ```\n\n2.  **Install dependencies:**\n\n    ```bash\n    npm install\n    # or\n    yarn install\n    ```\n\n3.  **Set up pre-commit hooks:**\n    (Ensures code quality before commits)\n\n    ```bash\n    npm run prepare\n    # or\n    yarn prepare\n    ```\n\n    You are now ready to contribute to the `@trysiren/node`!\n\n### Code Style \u0026 Linting\n\n- Code style is enforced by ESLint and Prettier\n- TypeScript type checking is handled by the TypeScript compiler\n- These tools are automatically run via pre-commit hooks\n\n### Running Tests\n\nTo run the test suite, use the following command from the project root directory:\n\n```bash\nnpm test\n# or\nyarn test\n```\n\nThis will execute all tests defined in the `src/__tests__/` directory.\n\n### Submitting Changes\n\n- Create a feature branch for your changes\n- Commit your changes (pre-commit hooks will run)\n- Push your branch and open a Pull Request against the `develop` repository branch\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyvaluesoftwaresystems%2Fsiren-ts-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeyvaluesoftwaresystems%2Fsiren-ts-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyvaluesoftwaresystems%2Fsiren-ts-sdk/lists"}