Tokens
A token proves that a connection belongs to your account. Create and manage tokens on the developer tokens page.
Creating a token
You need a signed-in account with a verified email address, on any plan. You also accept the developer terms before you create your first token. Signed-out visitors can read this wiki but cannot create a token.
The full token is shown once, when you create it. Apprentice Wizard stores it in a form that cannot be turned back into the token, so a lost token cannot be recovered. Create a new one and revoke the old one.
Tokens start with awgw_.
Limits
- A free account can have 1 active token at once, and any paid plan can have 5. Creating one more returns 409.
- You can create up to 10 tokens per account in a UTC day, and up to 30 per network. Past that, creation returns 429.
- Each token can have 2 connections open at the same time. A third closes with 4010 until one of the others closes. A connection that dropped without closing cleanly can keep counting for up to 90 seconds, so wait at least that long before you reconnect after a 4010.
Using a token
Treat the session_id from READY the same way, because a session id can resume a connection without a token.
In your own code, read the token from an environment variable such as AW_GATEWAY_TOKEN. Do not commit it.
Revoking a token
You can see each token's name, prefix, creation date and when it was last used, and revoke it from the tokens page. Revoking a token, or deleting the account that owns it, ends its access and closes its connections within 60 seconds. They close with 4012, and a resume or a new IDENTIFY with that token also gets 4012.
Administrators can revoke any token, and can switch the gateway off entirely. While it is off, new connections close with 4015.