config.js file.
Required configuration
Your Sol’s Stat Tracker API token. Generate this token using the
/generatetoken command in the Sol’s Stat Tracker Discord bot.The token must be a valid 72-character hexadecimal string. The WebSocket gateway authenticates your connection using this token in the request headers.Your Discord webhook URL where stat notifications will be posted. Create a webhook in your Discord server channel settings and copy the full URL.The webhook client uses this URL to establish a connection and send embed messages to your Discord channel.
Setup steps
-
Generate an API token
In Discord, use the Sol’s Stat Tracker bot to generate your token:
Copy the token provided by the bot.
-
Create a Discord webhook
- Navigate to your Discord server channel settings
- Go to Integrations > Webhooks
- Click “New Webhook” or “Create Webhook”
- Copy the webhook URL
-
Configure your credentials
Open
config.jsand add your credentials:
Authentication errors
The WebSocket client validates your authentication and may disconnect with specific error codes:| Code | Error | Description |
|---|---|---|
| 4001 | Missing token | The token field is empty or not provided |
| 4002 | Invalid token | The token format is incorrect or not recognized |
| 4003 | Already in use | Another client is already connected with this token |
| 4004 | Token deleted | Your API token has been deleted from the system |
If you encounter code 4003 (duplicate connection), only one client can be connected per token at a time. Close any other running instances before connecting again.