{"id":26797697,"url":"https://github.com/websublime/courier","last_synced_at":"2025-10-07T22:08:08.466Z","repository":{"id":54197447,"uuid":"339828354","full_name":"websublime/courier","owner":"websublime","description":"Events PUB/SUB","archived":false,"fork":false,"pushed_at":"2021-03-04T12:28:51.000Z","size":102,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T19:15:29.453Z","etag":null,"topics":["golang","pubsub"],"latest_commit_sha":null,"homepage":"","language":"Go","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/websublime.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-02-17T19:08:27.000Z","updated_at":"2021-03-04T12:28:53.000Z","dependencies_parsed_at":"2022-08-13T09:00:34.336Z","dependency_job_id":null,"html_url":"https://github.com/websublime/courier","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/websublime/courier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websublime%2Fcourier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websublime%2Fcourier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websublime%2Fcourier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websublime%2Fcourier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/websublime","download_url":"https://codeload.github.com/websublime/courier/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websublime%2Fcourier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278854405,"owners_count":26057460,"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-10-07T02:00:06.786Z","response_time":59,"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":["golang","pubsub"],"created_at":"2025-03-29T19:15:32.815Z","updated_at":"2025-10-07T22:08:08.438Z","avatar_url":"https://github.com/websublime.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Courier Publish/Subscribe\n\nCourier is an publish/subscriber socket to broadcast messages to every susbscription. All communication must be authenticated with a valid JWT token. \n\n## Rest endpoints\n\nCourier provide endpoints to manage the service. With this endpoints you will be able to create audience, obtain a signed url to use socket service and a hook enpoint to send messages to pub/sub.\n\nCreate a audience to group content and connections communications. Audience (aud) should be define in your JWT token. All endpoints are secure with a valid JWT. If you need a system to administrate user sign, etc please consider use [gotrue](https://github.com/websublime/gotrue) system.\n\n- POST /v1/audience\n\nCreates and audience from your jwt token\n\nReturns\n```json\n{\n  \"id\": \"11111111-2222-3333-4444-5555555555555\",\n  \"name\": \"my-audience.com\",\n  \"created_at\": \"2016-05-15T19:53:12.368652374-07:00\",\n  \"updated_at\": \"2016-05-15T19:53:12.368652374-07:00\"\n}\n```\n\n- POST /v1/topic\n\nCreates and a topic for a audience (jwt will give audience)\n\n```json {\n  {\n    \"topic\": \"system/events\"\n  }\n}\n\nReturns\n```json\n{\n  \"id\": \"11111111-2222-3333-4444-5555555555555\",\n  \"topic\": \"system/events\",\n  \"audience\": \"...\",\n  \"audienceId\": \"11111111-2222-3333-4444-5555555555555\",\n  \"created_at\": \"2016-05-15T19:53:12.368652374-07:00\",\n  \"updated_at\": \"2016-05-15T19:53:12.368652374-07:00\"\n}\n```\n\n- GET /v1/topic\n\nGet topics for a audience (jwt will give audience)\n\nReturns\n```json\n[{\n  \"id\": \"11111111-2222-3333-4444-5555555555555\",\n  \"topic\": \"system/events\",\n  \"audience\": \"...\",\n  \"audienceId\": \"11111111-2222-3333-4444-5555555555555\",\n  \"created_at\": \"2016-05-15T19:53:12.368652374-07:00\",\n  \"updated_at\": \"2016-05-15T19:53:12.368652374-07:00\"\n}]\n```\n\n- POST /v1/hook\n\nHook endpoint to publish events (message has to be object)\n\n```json\n{\n  \"topic\": \"system/events\",\n  \"action\": \"publish\",\n  \"message\": {\n    \"type\": \"database\"\n    ...\n  }\n}\n```\n\nReturns same object from body\n\n- GET /v1/sign\n\nObtain a signed to url to connect to socket. JWT audience will be use to generate your secure connection.\n\nReturns\n```json\n{\n  \"key\": \"8p2uzHww5V6tMdOMJKyxdUDYDzw6DyE2yucduoKtM_HwpXNR0JvHK_KanL9xX1bTlkjJ3lj5eZ2hOr0x-OQZfOFQcd2n4ukUQ2Tde1dXkLOvAMBbpJt14Fe\",\n  \"url\": \"ws://localhost:8883/ws?token=8p2uzHww5V6tMdOMJKyxdUDYDzw6DyE2yucduoKtM_HwpXNR0JvHK_KanL9xX1bTlkjJ3lj5eZ2hOr0x-OQZfOFQcd2n4ukUQ2Tde1dXkLOvAMBbpJt14Fe\"\n}\n```\n\n## PUB/SUB\n\nPub/Sub allows you to subscribe, unsubscribe, publish and broadcasts messages. After get a valid signed url the followings signatures for each type are:\n\n- Subscribe\n```json\n{\n  \"action\": \"subscribe\",\n  \"topic\": \"system/events\"\n}\n```\n\n- Unsubscribe\n```json\n{\n  \"action\": \"unsubscribe\",\n  \"topic\": \"system/events\"\n}\n```\n\n- Publish\n```json\n{\n  \"action\": \"publish\",\n  \"topic\": \"system/events\",\n  \"message\": {} //always object\n}\n```\n\n- Broadcast\n```json\n{\n  \"action\": \"broadcast\",\n  \"message\": {} //always object\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebsublime%2Fcourier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebsublime%2Fcourier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebsublime%2Fcourier/lists"}