Intermediate 8 min

Token & environment variables

Store your Discord token safely via the panel environment variables.

#Token#Env#Security

Ready to start your service? Check offers and order online.

View offers and order

Secure your token

Do not store never your Discord token in plain language in the code or a public repository. Use the environment variables of the panel.

  1. Open the Variables / Startup tab of the panel
  2. Add a variable, e.g. DISCORD_TOKENwith your token
  3. Read it in the code via process.env.DISCORD_TOKEN (Node) or os.environ (Python)

Example (Node.js)

In your code: client.login(process.env.DISCORD_TOKEN). No sensitive value appears in the files.

Regenerating in case of leakage

If your token has been exposed, re-generate it immediately on the Discord developer portal, then update the environment variable and restart.

Next steps