Home Docs Quick Start

Quick Start

Get VYREX running on Vercel with Discord integration in under 10 minutes.

  1. Fork or clone the repository to your GitHub account.
  2. Import to Vercel — go to vercel.com/new, choose your repo, and deploy.
  3. Add environment variables in Vercel → Project → Settings → Environment Variables. At minimum: DISCORD_CLIENT_ID, DISCORD_CLIENT_SECRET, DISCORD_BOT_TOKEN, VYREX_OWNER_DISCORD_ID.
  4. Set up Upstash Redis — create a free database at upstash.com and add UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.
  5. Add OAuth redirect — in the Discord Developer Portal, under your app → OAuth2 → Redirects, add https://your-domain.vercel.app/oauth-callback.
  6. Redeploy so new env vars take effect. Then open /dashboard and click Sync from Discord.
Tip: Check /status to verify all services are configured correctly before inviting users.
Home Docs Deployment

Deployment

VYREX is designed for Vercel but runs anywhere Node.js serverless functions are supported.

Vercel (recommended)

The root vercel.json handles all routing. Static files are served from the root directory; API functions live in api/.

vercel.json — key rewrites
{
  "rewrites": [
    { "source": "/dashboard", "destination": "/dashboard.html" },
    { "source": "/api/discord-token", "destination": "/api/oauth?__op=discord-token" },
    { "source": "/api/bot-config", "destination": "/api/bot-config" }
  ]
}
Important: After adding or changing environment variables on Vercel, you must redeploy for them to take effect. Go to Deployments → ⋯ → Redeploy.

Self-hosted / other providers

Run npm install then serve static files with any web server and set up serverless functions using the provider's Node.js runtime. Ensure all /api/* paths route to the corresponding api/*.js files.

Home Docs Environment Variables

Environment Variables

All configuration is done through environment variables. Never commit secrets to your repository.

Discord (required)

VariableRequiredDescription
DISCORD_CLIENT_IDRequiredYour Discord application's client / application ID
DISCORD_CLIENT_SECRETRequiredOAuth2 client secret for token exchange
DISCORD_BOT_TOKENRequiredBot token from Discord Developer Portal → Bot → Token
DISCORD_APPLICATION_IDOptionalSame as DISCORD_CLIENT_ID — used as fallback

Access Control

VariableRequiredDescription
VYREX_OWNER_DISCORD_IDRequiredFounder Discord user ID — full platform access
VYREX_COOWNER_DISCORD_IDSOptionalComma-separated Owner-tier Discord IDs
VYREX_STAFF_DISCORD_IDSOptionalComma-separated Staff-tier Discord IDs
VYREX_DASH_API_KEYOptionalLong random string for API key auth (no OAuth needed)

Storage

VariableRequiredDescription
UPSTASH_REDIS_REST_URLRecommendedUpstash Redis REST endpoint URL
UPSTASH_REDIS_REST_TOKENRecommendedUpstash Redis REST token
VYREX_ALLOW_MEMORY_FALLBACKOptionalSet to true to allow in-memory fallback when Redis is unavailable
Note: Without Redis, sessions are stored in-memory and lost on function restart. For production, always configure Upstash Redis.
Home Docs Bot Setup

Bot Setup

Configure your Discord application and bot token for full dashboard integration.

Creating your Discord Application

  1. Go to discord.com/developers/applications and click New Application.
  2. Under Bot, click Add Bot. Copy the token and add it as DISCORD_BOT_TOKEN on Vercel.
  3. Under OAuth2 → General, copy the Client ID and Client Secret. Add them as DISCORD_CLIENT_ID and DISCORD_CLIENT_SECRET.
  4. Under OAuth2 → Redirects, add your deployment URL: https://your-domain.vercel.app/oauth-callback.
  5. Enable Presence Intent, Server Members Intent, and Message Content Intent under Bot → Privileged Gateway Intents.

Inviting the bot

Use the Add bot to Discord button on the homepage, or generate the invite URL manually:

https://discord.com/api/oauth2/authorize
  ?client_id=YOUR_CLIENT_ID
  &permissions=8
  &scope=bot%20applications.commands
Home Docs Bot Branding

Bot Branding

Customise your bot's avatar, status, activity, and per-server nicknames from the dashboard.

Global Settings

Navigate to Dashboard → Bot Branding. Changes are saved to /api/bot-config (Redis-backed) and your local cache. Your bot worker reads these settings on startup or when you trigger a /reload command.

SettingDescription
Avatar URLPNG/JPG image URL. Your bot must have permissions to change its avatar via the API.
Banner URLProfile banner (requires Discord Nitro on the bot account).
Global NicknameDefault display name across all servers (max 32 chars).
Brand ColourHex colour used in auto-generated embeds and the dashboard accent.
Activity TypeWatching, Playing, Listening to, Competing in, Streaming, or Custom.
Activity TextText shown after the activity type in the member list (max 128 chars).
Online StatusOnline (green), Idle (yellow), Do Not Disturb (red), Invisible.

Per-server Nicknames

In the Per-server Nicknames card, add rows for each server where you want a custom nickname. These are stored separately at /api/bot-config?guildId=SERVER_ID and can be read individually by your bot worker per guild.

API format: POST /api/bot-config with {"guildId": "123", "nickname": "MyBot"} saves a per-guild config. GET /api/bot-config?guildId=123 retrieves it.
Home Docs Commands

Commands

VYREX supports both slash commands (/command) and the legacy text prefix (>command).

Core Commands

CommandDescription
/helpList all available commands with descriptions
/setupInteractive server setup wizard (admin only)
/prefix <char>Change the text command prefix for this server
/statusShow bot status, shard, and uptime
/reloadReload bot config from /api/bot-config (owner only)
/pingShow bot latency and Discord API response time
/ban <user>Ban a user from the server
/kick <user>Kick a user from the server
/mute <user>Timeout a user (requires Moderate Members permission)
/warn <user>Issue a warning (logged to audit)
/embedSend a custom embed using the Embed Builder config
Home Docs Authentication

Authentication

VYREX uses PKCE-based Discord OAuth and server-backed email/password sessions via Upstash Redis.

Discord OAuth (PKCE)

  1. User clicks Continue with Discord. The browser generates a 48-byte random code verifier.
  2. The SHA-256 hash of the verifier (code challenge) is sent to Discord's authorize URL.
  3. Discord redirects to /oauth-callback with an auth code.
  4. The callback calls POST /api/discord-token, sending the code + verifier. The server exchanges these for an access token without the client_secret ever touching the browser.
  5. The access token is used to call GET /users/@me on Discord's API to get the user's ID and email.

Email + Password

Accounts are stored in Upstash Redis under vyrex:acc:<id>. Passwords are hashed server-side with scrypt. Sessions are 32-byte random tokens stored under vyrex:sess:<token> with a 30-day TTL.

Tier System

All role checks happen server-side in api/_lib/serverAccountTier.js:

TierAccess LevelSet via
FounderFull platform access including Founder panelVYREX_OWNER_DISCORD_ID
OwnerTeam management, system ops, subscriptionsVYREX_COOWNER_DISCORD_IDS
StaffAnalytics, logs, admin accounts viewVYREX_STAFF_DISCORD_IDS
MemberDashboard, commands, modules, automationsEveryone else
Home Docs Embed Builder

Embed Builder

Build rich Discord embeds visually and export the JSON to use in any bot.

Using the Embed Builder

Navigate to Dashboard → Embed Builder. The live preview updates as you type. When done, click Copy JSON to get the payload.

JSON Output Format

{
  "embeds": [{
    "color": 5046271,
    "author": { "name": "VYREX", "url": "https://vyrex.gg" },
    "title": "Embed Title",
    "description": "Your **markdown** text here.",
    "fields": [
      { "name": "Field 1", "value": "Value 1", "inline": true },
      { "name": "Field 2", "value": "Value 2", "inline": true }
    ],
    "footer": { "text": "VYREX Bot" },
    "timestamp": "2025-01-01T00:00:00.000Z"
  }]
}

Quick Presets

8 built-in presets: Welcome, Announcement, Warning, Success, Error, Info, Rules, Event. Click any to load it into the builder.

Tip: Save your custom embeds as named presets using Save preset — they're stored in your browser and persist across sessions.
Home Docs Team & Roles

Team & Roles

Manage your platform team using Discord ID allowlists on Vercel environment variables.

Adding Team Members

  1. Get the team member's Discord user ID (right-click their name in Discord → Copy User ID, with Developer Mode on).
  2. Add the ID to VYREX_COOWNER_DISCORD_IDS (Owner) or VYREX_STAFF_DISCORD_IDS (Staff) on Vercel — comma-separated for multiple IDs.
  3. Redeploy the project. The team member can now sign in with Discord and access their tier-appropriate sections.
Note: The Founder panel is exclusively for the single Discord ID set in VYREX_OWNER_DISCORD_ID. It cannot be shared or transferred.
Home Docs API Overview

API Overview

All VYREX API routes are serverless Node.js functions deployed alongside the static site.

Base URL

https://your-domain.vercel.app/api/

Authentication

API routes accept two auth methods:

  • API Key: x-vyrex-api-key: YOUR_DASH_API_KEY header — full access
  • Discord OAuth: Authorization: Bearer DISCORD_ACCESS_TOKEN — access scoped by Discord ID tier

Available Routes

RouteMethodDescription
/api/healthGETService health check — no auth required
/api/discord-tokenPOSTExchange Discord auth code for access token
/api/auth-accountsGET/POST/PUTUser account management and sessions
/api/bot-snapshotGETFetch bot's guilds from Discord API
/api/bot-configGET/POSTBot branding and per-server configuration
/api/workspace-storeGET/POSTPersist dashboard workspace state to Redis
/api/guild-planGET/POSTManage per-guild billing plan
/api/connection-statusGETConfiguration and storage health summary
/api/connection-selftestGETFull self-test with latency measurements
Home Docs Auth Endpoints

Auth Endpoints

The /api/auth-accounts endpoint handles registration, login, sessions, and admin operations.

POST /api/auth-accounts — Register

{ "action": "register", "email": "user@example.com", "password": "secret", "displayName": "Alex" }

POST /api/auth-accounts — Login

{ "action": "login", "email": "user@example.com", "password": "secret" }

Returns: { "ok": true, "token": "SESSION_TOKEN", "account": {...}, "tier": "member" }

GET /api/auth-accounts?me=1

Requires Authorization: Bearer SESSION_TOKEN. Returns the current account and computed tier.

Home Docs Bot Config API

Bot Config API

Store and retrieve bot customisation settings per-guild or globally.

GET /api/bot-config

Returns global config. Append ?guildId=SERVER_ID for per-guild config.

POST /api/bot-config — Global

{
  "activityType": "watching",
  "activityText": "your server",
  "onlineStatus": "online",
  "brandColor": "#4d7cff",
  "globalNick": "VYREX",
  "avatarUrl": "https://cdn.example.com/avatar.png"
}

Requires Founder or Owner auth (API key or elevated Discord ID).

POST /api/bot-config — Per-guild

{ "guildId": "1234567890", "nickname": "MyBot", "prefix": "!", "embedColor": "#00e894" }

Requires any valid auth (Discord OAuth or API key).

Home Docs FAQ

FAQ

Common questions about VYREX setup and configuration.

Why does /api/bot-snapshot show 0 servers?

The bot snapshot requires DISCORD_BOT_TOKEN set on Vercel and a valid Discord or API key auth header. Sign in with Discord in the dashboard and click Sync from Discord.

My session expires — how do I extend it?

Sessions last 30 days (Redis TTL). The dashboard auto-refreshes the server session if you're active. Re-signing in creates a fresh session.

Can I run multiple bots from one dashboard?

Currently one bot token per deployment. To manage multiple bots, deploy separate instances of VYREX with different environment variables.

How do I enable Stripe billing?

Add STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, STRIPE_PRICE_PRO, and STRIPE_PRICE_PREMIUM to Vercel. The /api/stripe-session handler is ready.

Home Docs Troubleshooting

Troubleshooting

Common issues and how to fix them.

"Failed to fetch" on Discord sign-in

The /api/discord-token route is not reachable. Check: (1) the site is deployed on Vercel (not opened as a file), (2) DISCORD_CLIENT_SECRET is set, (3) the redirect URI in Discord Portal matches exactly.

Sessions not persisting across devices

Configure Upstash Redis. Without it, sessions are in-memory and lost on function cold starts.

Bot branding not applying to Discord

The dashboard saves config to /api/bot-config. Your bot worker must read this endpoint and call Discord's API to apply changes. The dashboard does not directly control Discord — it manages your config store.

Owner/Staff access not working

Make sure you signed in with Discord OAuth (not just email). The tier check compares your Discord user ID against the env var allowlists. After adding IDs, redeploy Vercel.

Still stuck? Visit Support or open an issue on GitHub.