Authentication
Get your API key and authenticate requests.
Most API endpoints require an API key for authentication. You can get one from your bot's edit page on the DiscordForge Dashboard.
How to Get Your API Key
- Go to your Dashboard.
- Click Edit on the bot you want to manage.
- Scroll down to the API Access section.
- Click Generate or Regenerate to get your token.
Setting Up the Client
index.ts
1import { ForgeClient } from "discordforge-sdk";2 3const forge = new ForgeClient(process.env.FORGE_API_KEY, process.env.FORGE_BOT_ID);Environment Variables
Store your API key in a .env file and never commit it to version control.
.env
1FORGE_API_KEY=your_api_key_here2FORGE_BOT_ID=your_bot_discord_idAuthentication Headers
The SDK sends your API key automatically. If you're making raw HTTP requests, include it as either header:
1Authorization: <YOUR_API_KEY>2// or3x-api-key: <YOUR_API_KEY>Public Endpoints
The Get Bot Info endpoint is public and does not require authentication.
