{"id":13521878,"url":"https://github.com/boyney123/cdk-eventbridge-socket","last_synced_at":"2025-07-28T23:09:46.830Z","repository":{"id":41966416,"uuid":"399579749","full_name":"boyney123/cdk-eventbridge-socket","owner":"boyney123","description":"CDK construct that creates a WebSocket endpoint for you for any EventBridge rule you are interested in. (Built for debugging + testing )","archived":false,"fork":false,"pushed_at":"2022-10-28T21:37:52.000Z","size":580,"stargazers_count":52,"open_issues_count":6,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-13T18:10:02.502Z","etag":null,"topics":["aws","aws-construct","aws-constructs","awscdk","cdk","cdk-examples","eventbridge"],"latest_commit_sha":null,"homepage":"https://boyney123.github.io/cdk-eventbridge-socket/","language":"HTML","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/boyney123.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}},"created_at":"2021-08-24T19:19:21.000Z","updated_at":"2025-06-12T04:43:58.000Z","dependencies_parsed_at":"2022-08-12T00:50:39.945Z","dependency_job_id":null,"html_url":"https://github.com/boyney123/cdk-eventbridge-socket","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/boyney123/cdk-eventbridge-socket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boyney123%2Fcdk-eventbridge-socket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boyney123%2Fcdk-eventbridge-socket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boyney123%2Fcdk-eventbridge-socket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boyney123%2Fcdk-eventbridge-socket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boyney123","download_url":"https://codeload.github.com/boyney123/cdk-eventbridge-socket/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boyney123%2Fcdk-eventbridge-socket/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267600455,"owners_count":24113786,"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-07-28T02:00:09.689Z","response_time":68,"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":["aws","aws-construct","aws-constructs","awscdk","cdk","cdk-examples","eventbridge"],"created_at":"2024-08-01T06:00:39.027Z","updated_at":"2025-07-28T23:09:46.812Z","avatar_url":"https://github.com/boyney123.png","language":"HTML","funding_links":[],"categories":["Tools"],"sub_categories":[],"readme":"# [cdk-eventbridge-socket](https://boyney123.github.io/cdk-eventbridge-socket/)\n\nThis is an AWS CDK Construct that will listen for any EventBridge Bus and Rule and forward that event through a websocket.\n\n**Get setup in seconds and as easy as 7 lines of code.**\n\n### Why\n\nYou may want to use tools like [Postman Websockets](https://blog.postman.com/postman-supports-websocket-apis/) or [websocat](https://github.com/vi/websocat) to see and debug what events are being fired through your event bus.\n\n### How\n\nThis uses AWS ApiGateway, DynamoDB (to store connections) and Lambda.\n\n![Architecture](architecture.png)\n\n## Installation and Usage\n\n### Typescript\n\n```console\nnpm install --save cdk-eventbridge-socket\n```\n\n```typescript\nimport * as cdk from '@aws-cdk/core';\n\nimport { EventBridgeWebSocket } from 'cdk-eventbridge-socket';\n\nexport class EventbridgeWebhooksStack extends cdk.Stack {\n  constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {\n    super(scope, id, props);\n\n    new EventBridgeWebSocket(this, 'sockets', {\n      bus: 'your-event-bus-name',\n\n      // This example shows how to listen for all events\n      eventPattern: {\n        account: ['your_account_id'],\n      },\n      stage: 'dev',\n    });\n  }\n}\n```\n\nWhen using the `cdk-eventbridge-socket` the new websocket url will be output on your terminal.\n\n## Usage\n\nThere are only a few properties you have to set `bus`, `eventPattern` and `stage`.\n\nYou can listen to any EventBridge source/pattern you like, just replace the `eventPattern` with what you want to listen to.\n\n#### Examples\n\n##### Listen for a detailType\n\n```typescript\nnew EventBridgeWebSocket(this, 'sockets', {\n  bus: 'your-event-bus-name',\n\n  // Listens for all UserCreated events\n  eventPattern: {\n    detailType: ['UserCreated'],\n  },\n  stage: 'dev',\n});\n```\n\n##### Listen for a source\n\n```typescript\nnew EventBridgeWebSocket(this, 'sockets', {\n  bus: 'your-event-bus-name',\n\n  // Listens for all events on source\n  eventPattern: {\n    source: ['myapp.users'],\n  },\n  stage: 'dev',\n});\n```\n\nYou can find more [here on the AWS documentation](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.EventPattern.html)\n\n# Contributing\n\nIf you have any questions, features or issues please raise any issue or pull requests you like. I will try my best to get back to you.\n\n# License\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboyney123%2Fcdk-eventbridge-socket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboyney123%2Fcdk-eventbridge-socket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboyney123%2Fcdk-eventbridge-socket/lists"}