{"id":18928138,"url":"https://github.com/hearthsim/twitch-hdt-ebs","last_synced_at":"2026-03-17T19:39:31.831Z","repository":{"id":25099710,"uuid":"103182585","full_name":"HearthSim/twitch-hdt-ebs","owner":"HearthSim","description":"📢 Twitch Extension Backend Service for Hearthstone Deck Tracker.","archived":false,"fork":false,"pushed_at":"2025-04-30T11:21:10.000Z","size":130,"stargazers_count":16,"open_issues_count":1,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-07-01T01:42:06.952Z","etag":null,"topics":["django","hearthstone","twitch","twitch-extension-backend-service","twitch-extensions"],"latest_commit_sha":null,"homepage":"","language":"Python","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/HearthSim.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":"2017-09-11T20:07:46.000Z","updated_at":"2025-04-30T11:21:14.000Z","dependencies_parsed_at":"2024-02-15T00:23:32.115Z","dependency_job_id":"6292cbb0-d1cb-4976-8d50-593b60be2b11","html_url":"https://github.com/HearthSim/twitch-hdt-ebs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HearthSim/twitch-hdt-ebs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HearthSim%2Ftwitch-hdt-ebs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HearthSim%2Ftwitch-hdt-ebs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HearthSim%2Ftwitch-hdt-ebs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HearthSim%2Ftwitch-hdt-ebs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HearthSim","download_url":"https://codeload.github.com/HearthSim/twitch-hdt-ebs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HearthSim%2Ftwitch-hdt-ebs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271657788,"owners_count":24797935,"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-22T02:00:08.480Z","response_time":65,"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":["django","hearthstone","twitch","twitch-extension-backend-service","twitch-extensions"],"created_at":"2024-11-08T11:23:06.866Z","updated_at":"2026-03-17T19:39:31.792Z","avatar_url":"https://github.com/HearthSim.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Twitch HDT EBS\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/hearthsim/hdt-twitch-ebs/ci.yml)](https://github.com/HearthSim/hdt-twitch-ebs/actions/workflows/ci.yml)\n\nTwitch Extension Backend Service for [Hearthstone Deck Tracker](https://hsdecktracker.net).\n\n\n## API Usage\n\n### Authentication\n\nAuthentication happens exclusively through HSReplay.net OAuth2.\nThe API accepts valid [OAuth2 Bearer Tokens](https://github.com/HearthSim/HSReplay.net/wiki/OAuth2-API-docs).\n\n### Twitch Metadata Headers\n\nWith every request, the following two headers should be send:\n\n* **X-Twitch-Client-Id**: The client ID of the configured extension.\n  An HTTP 400 will be returned if this header is missing or not valid.\n* **X-Twitch-User-Id**: The Twitch User ID (channel ID) of the user's Twitch channel.\n  An HTTP 400 will be returned if this header is missing.\n* **X-Twitch-Extension-Version**: The version of the extension that has been installed.\n  Only used if available (eg. by Javascript clients).\n\nThe Twitch User ID must correspond to a [linked Twitch account on HSReplay.net](https://hsreplay.net/account/social/connections/)\nfor the same account as the one the client authenticates itself against.\nIf the User ID is not one of the account's linked Twitch accounts, an HTTP 403\nwill be returned with the error `channel_not_allowed` and extra details.\nExample:\n\n```\nPOST /send/ HTTP/1.1\nAccept: application/json\nAuthorization: Bearer xxxxxxxxxxxx\nX-Twitch-Client-Id: d72hk844mgvex3kbfhrgjtdoeqrh0t\nX-Twitch-User-Id: 1111111\n...\n\nHTTP/1.0 403 Forbidden\nAllow: POST, OPTIONS\nContent-Type: application/json\n\n{\n    \"available_channels\": [\"123456\", \"123654\"],\n    \"error\": \"channel_not_allowed\",\n    \"detail\": \"No permission for channel '1111111'\"\n}\n```\n\n\n### `POST /send/`: PubSub Send endpoint\n\nThe `/send/` endpoint allows sending pubsub JSON messages to the twitch channel specified in the `X-Twitch-User-Id` HTTP header.\nThe endpoint expects a POST with data formatted as `{\"type\": \"...\", \"data\": {...}}`.\nThe input is validated, signed with the extension's locally-configured secret, then\n[submitted to the Twitch Extension PubSub API](https://dev.twitch.tv/docs/extensions/reference#send-extension-pubsub-message).\n\n\n### `POST /setup/`: Verify and update setup state\n\nThe `/setup/` endpoint takes the same twitch metadata headers but expects no input.\nAuthentication happens using a Twitch JWT which is verified then paired up with a HearthSim user.\nThis endpoint allows verifying that OAuth2 permissions and Twitch setup is in order. Upon HTTP POST,\nthe Twitch user's extension's `required_configuration` setting\n[will be updated](https://dev.twitch.tv/docs/extensions/reference#set-extension-required-configuration)\nto signal the setup being complete, thereby allowing the user to complete the extension setup on Twitch.\n\n\n## EBS configuration\n\n### Settings\n\nThe EBS looks for the following application settings:\n\n* `EBS_APPLICATIONS`: A dictionary of Twitch Extension Client ID -\u003e Configuration for each configured extension.\n  The expected configuration is a `secret` string, which is the extension secret (as provided in Base64), and an\n  `owner_id` string, which is the owner ID of the Twitch extension.\n* `EBS_JWT_TTL_SECONDS`: The TTL (in seconds) of JWTs used to communicate with the Twitch API. Default: `120`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhearthsim%2Ftwitch-hdt-ebs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhearthsim%2Ftwitch-hdt-ebs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhearthsim%2Ftwitch-hdt-ebs/lists"}