{"id":23134908,"url":"https://github.com/4players/odin-tokens","last_synced_at":"2025-08-17T09:32:57.760Z","repository":{"id":57093716,"uuid":"403573841","full_name":"4Players/odin-tokens","owner":"4Players","description":"Lightweight module to generate access keys and room tokens used by 4Players ODIN","archived":false,"fork":false,"pushed_at":"2023-06-07T10:56:58.000Z","size":477,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-30T12:40:45.959Z","etag":null,"topics":["authentication","ed25519","javascript","jwt","nodejs","npm","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/4Players.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2021-09-06T10:07:19.000Z","updated_at":"2024-06-21T19:09:30.384Z","dependencies_parsed_at":"2024-06-21T19:09:23.906Z","dependency_job_id":"db661c48-78a4-4223-ae10-89076cf6413c","html_url":"https://github.com/4Players/odin-tokens","commit_stats":{"total_commits":21,"total_committers":4,"mean_commits":5.25,"dds":0.5238095238095238,"last_synced_commit":"fcfa34077db907fbdeae79239723d83b36490e30"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4Players%2Fodin-tokens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4Players%2Fodin-tokens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4Players%2Fodin-tokens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4Players%2Fodin-tokens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4Players","download_url":"https://codeload.github.com/4Players/odin-tokens/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230113643,"owners_count":18175221,"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":["authentication","ed25519","javascript","jwt","nodejs","npm","typescript"],"created_at":"2024-12-17T12:13:38.961Z","updated_at":"2024-12-17T12:13:39.597Z","avatar_url":"https://github.com/4Players.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @4players/odin-tokens\n\n[![npm](https://img.shields.io/npm/v/@4players/odin-tokens.svg)][npm-badge-url]\n[![npm](https://img.shields.io/npm/l/@4players/odin-tokens.svg)][license-url]\n[![npm](https://img.shields.io/npm/dm/@4players/odin-tokens.svg)][npm-badge-url]\n\nThis is a lightweight module to generate API keys and tokens used by 4Players ODIN.\n\n4Players ODIN is a cross-platform software development kit (SDK) that enables developers to integrate voice and video chat technology into multiplayer games.\n\n## Flowchart\n\n```mermaid\ngraph TB\n  RandomBytes[Random Bytes] --\u003e AccessKey;\n  AccessKey --\u003e PublicKey;\n  AccessKey --\u003e SecretKey;\n  PublicKey --\u003e KeyId;\n```\n\n## Example\n\n```typescript\nimport { TokenGenerator } from \"@4players/odin-tokens\";\n\nconst accessKey = \"\u003cYOUR API KEY HERE\u003e\";\nconst generator = new TokenGenerator(accessKey);\nconst token = generator.createToken(\"my room\", \"john doe\");\n\nconsole.log(`generated a new token: ${token}`);\n```\n\n## Terminology\n\n| Term      | Description                                                                                                                                         |\n| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |\n| AccessKey | Gives access to the ODIN network for a customer. It is a 44 character long Base64-String, which consists of a version, random bytes and a checksum. |\n| SecretKey | Generated from the AccessKey, it is based on the Ed25519-Curve and used to sign a Token generated by the customer.                                  |\n| PublicKey | Generated from the AccessKey, it is based on the Ed25519-Curve and must be uploaded to 4Players so that a generated Token can be verified.          |\n| KeyId     | A shortened PublicKey, included in Token, making it possible to identify what PublicKey must be used to verify the Token.                           |\n| Token     | A [JWT] given to the game clients that allows them to connect to a voice/video chat room in the ODIN network.                                       |\n\n[jwt]: https://en.wikipedia.org/wiki/JSON_Web_Token\n[npm-badge-url]: https://www.npmjs.com/package/@4players/odin-tokens\n[license-url]: https://github.com/4Players/odin-tokens/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4players%2Fodin-tokens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4players%2Fodin-tokens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4players%2Fodin-tokens/lists"}