1.5.0 • Published 15 days ago

@4players/odin-tokens v1.5.0

Weekly downloads
-
License
ISC
Repository
github
Last release
15 days ago

@4players/odin-tokens

npm npm npm

This is a lightweight module to generate API keys and tokens used by 4Players ODIN.

4Players ODIN is a cross-platform software development kit (SDK) that enables developers to integrate voice and video chat technology into multiplayer games.

Flowchart

graph TB
  RandomBytes[Random Bytes] --> AccessKey;
  AccessKey --> PublicKey;
  AccessKey --> SecretKey;
  PublicKey --> KeyId;

Example

import { TokenGenerator } from "@4players/odin-tokens";

const accessKey = "<YOUR API KEY HERE>";
const generator = new TokenGenerator(accessKey);
const token = generator.createToken("my room", "john doe");

console.log(`generated a new token: ${token}`);

Terminology

TermDescription
AccessKeyGives 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.
SecretKeyGenerated from the AccessKey, it is based on the Ed25519-Curve and used to sign a Token generated by the customer.
PublicKeyGenerated from the AccessKey, it is based on the Ed25519-Curve and must be uploaded to 4Players so that a generated Token can be verified.
KeyIdA shortened PublicKey, included in Token, making it possible to identify what PublicKey must be used to verify the Token.
TokenA JWT given to the game clients that allows them to connect to a voice/video chat room in the ODIN network.
1.5.0

15 days ago

1.4.0

11 months ago

1.2.0

2 years ago

1.3.0

1 year ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.1.0

3 years ago

0.0.5

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago