Skip to Content
Account & SettingsTokens & Authentication

Tokens & Authentication

Nexmod uses several authentication mechanisms for different parts of the platform.

User Authentication

Nexmod uses Clerk  for user authentication. Sign in with your email or a social provider. User accounts are synced to Nexmod’s database on creation and update.

Agent Tokens

Agent tokens are long-lived API keys used by the Desktop App and other external clients to connect to Nexmod’s WebSocket servers.

Agent tokens are available on Pro plans and above.

Properties

PropertyDescription
NameA label to identify the token
TokenThe secret value (shown only once on creation)
Expires AtOptional expiration date
Last UsedWhen the token was last used for authentication
RevokedWhether the token has been revoked

Creating a Token

  1. Navigate to Settings → Tokens in the dashboard
  2. Click Create Token
  3. Give it a name and optionally set an expiration
  4. Copy the token immediately — it won’t be shown again

Revoking a Token

Click Revoke next to any token to immediately invalidate it. Revoked tokens cannot be used to authenticate.

How Tokens Are Used

Agent tokens authenticate WebSocket connections. When connecting, the client provides the token as a query parameter. The server hashes it (SHA-256) and looks up the corresponding token record in the database.

Desktop App Pairing

The Desktop App uses a simplified pairing flow instead of manual token management:

  1. In the dashboard, go to Settings → Tokens and click Generate Pairing Code
  2. A short-lived 6-digit code and a deep link (nexmod://pair?code=...) are created
  3. Enter the code in the Desktop App (or click the deep link)
  4. The app exchanges the code for an agent token via the /api/agent-tokens/exchange endpoint
  5. The app stores the token and connects automatically

Pairing Code Properties

PropertyDescription
Code6-character pairing code
Expires AtShort expiration (minutes)
Used AtWhen the code was exchanged for a token

Session Tokens

For the web dashboard’s real-time features (like live chat preview), short-lived session tokens are created automatically. These expire quickly and are not user-manageable.

Connected Accounts

When you connect Twitch or Discord through the dashboard, Nexmod securely stores OAuth tokens:

PropertyDescription
PlatformTwitch, Discord, etc.
Platform User IDYour ID on that platform
Access TokenEncrypted OAuth access token
Refresh TokenEncrypted OAuth refresh token
ScopesPermissions granted to Nexmod

Tokens are encrypted at rest and automatically refreshed when they expire.

Dashboard Permissions

ActionRequired Permission
View tokenstokens:read — Admin and above
Create, revoke tokenstokens:manage — Admin and above
Last updated on