{"id":15365437,"url":"https://github.com/epiphone/simple-sns-publisher","last_synced_at":"2025-07-07T06:34:26.010Z","repository":{"id":151575111,"uuid":"115106319","full_name":"epiphone/simple-sns-publisher","owner":"epiphone","description":"A simple SNS event publisher.","archived":false,"fork":false,"pushed_at":"2018-01-16T13:13:15.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T19:23:00.798Z","etag":null,"topics":["aws-sns","event-emitter","event-publisher","events","messaging","messaging-library"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/epiphone.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2017-12-22T10:44:59.000Z","updated_at":"2018-01-15T23:12:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"cb94f354-397c-4467-979c-5a93c8b89e90","html_url":"https://github.com/epiphone/simple-sns-publisher","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":"0.19999999999999996","last_synced_commit":"8d23b261d48a4c83c815b74d27a4f005985a94c2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiphone%2Fsimple-sns-publisher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiphone%2Fsimple-sns-publisher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiphone%2Fsimple-sns-publisher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiphone%2Fsimple-sns-publisher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/epiphone","download_url":"https://codeload.github.com/epiphone/simple-sns-publisher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247953090,"owners_count":21023945,"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","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":["aws-sns","event-emitter","event-publisher","events","messaging","messaging-library"],"created_at":"2024-10-01T13:14:46.100Z","updated_at":"2025-04-09T00:48:45.976Z","avatar_url":"https://github.com/epiphone.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-sns-publisher\n\n[![Build Status](https://travis-ci.org/epiphone/simple-sns-publisher.svg?branch=master)](https://travis-ci.org/epiphone/simple-sns-publisher) [![codecov](https://codecov.io/gh/epiphone/simple-sns-publisher/branch/master/graph/badge.svg)](https://codecov.io/gh/epiphone/simple-sns-publisher)\n\nA simple wrapper over [AWS NodeJS SDK](https://aws.amazon.com/sdk-for-node-js/) for publishing JSON-formatted messages on a SNS topic.\n\n## ~~Install~~\n\n~~`yarn install simple-sns-publisher`~~\n\n**Still under development!**\n\n## Usage\n\n```typescript\nimport { SimpleSNSPublisher } from 'simple-sns-publisher'\n\nconst sns = new SimpleSNSPublisher()\nsns.publish({\n  message: { eventId: '1234-asdf', someKey: 'value' },\n  topicARN: 'arn:aws:sns:us-west-2:111122223333:MyTopic'\n})\n```\n\nThe above results in the following SNS message:\n\n```json\n{\n  \"Message\": {\"eventId\": \"1234-asdf\", \"someKey\": \"value\"},\n  \"TopicArn\": \"arn:aws:sns:us-west-2:111122223333:MyTopic\"\n}\n```\n\n## Configuration options\n\n```typescript\n/**\n * SNS publisher constructor options.\n */\nexport interface ISimpleSNSPublisherOptions {\n  /**\n   * AWS client configuration passed on to the SNS object constructor.\n   * Define your API keys either here or in environment variables.\n   */\n  awsConfig: AWS.SNS.Types.ClientConfiguration\n\n  /**\n   * Whether logging is enabled or not - defaults to true.\n   */\n  logEnabled: boolean\n\n  /**\n   * The handler used to log publish result/error - defaults to\n   * console.log/console.error. E.g. a Winston instance can be passed here.\n   */\n  logHandler: {\n    info: (args: { options: IPublishOptions; result: AWS.SNS.Types.PublishResponse }) =\u003e any\n    error: (args: { options: IPublishOptions; error: AWS.AWSError }) =\u003e any\n  }\n\n  /**\n   * Logging level - defaults to 'info'. Set to 'error' to only log errors.\n   */\n  logLevel: 'info' | 'error'\n\n  /**\n   * Whether publish errors should be propagated or just logged - defaults to true.\n   */\n  throwError: boolean\n}\n```\n\n## Related projects\n\n- The handy [aws-sdk-mock](https://github.com/dwyl/aws-sdk-mock) mocking library used for tests\n\n## TODO\n\n- Set SNS message attributes to allow filtering\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepiphone%2Fsimple-sns-publisher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fepiphone%2Fsimple-sns-publisher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepiphone%2Fsimple-sns-publisher/lists"}