Installation

Install @fluxerjs/core, set your token, and run a first bot.

Requirements

Node.js 22.13 or newer. ESM works out of the box ("type": "module" in package.json, or .mjs files).

Install

Prefer pnpm:

bash
pnpm add @fluxerjs/core

Also fine: npm install @fluxerjs/core or yarn add @fluxerjs/core.

Optional packages when you need them:

bash
pnpm add @fluxerjs/voice           # see the Voice guide
pnpm add @fluxerjs/builders        # if you import builders separately (also re-exported from core)
pnpm add @fluxerjs/sharding        # process sharding when one process is not enough
pnpm add @fluxerjs/sharding-redis  # multi-machine shard leases

Bot token

Create a bot in the Fluxer developer portal and copy the token. Put it in the environment rather than hardcoding it:

bash
# Windows PowerShell
$env:FLUXER_BOT_TOKEN="your_token"
node bot.js

# macOS / Linux
FLUXER_BOT_TOKEN=your_token node bot.js

Or use a .env file with a loader of your choice. The examples folder has an .env.example you can copy.

First run

javascript
import { Client, Events } from '@fluxerjs/core';

const client = new Client();

client.on(Events.Ready, () => {
  console.log(`Logged in as ${client.user?.username}`);
});

await client.login(process.env.FLUXER_BOT_TOKEN);

When you are ready to reply to messages, listen for Events.MessageCreate and match !ping yourself (see Basic bot). For several commands, parse with parsePrefixCommand (see Prefix commands).

Getting Started path

  1. Installation (this page)
  2. Basic bot
  3. Prefix commands
  4. Errors (FluxerError cheat sheet)
  5. Caching (limits, get vs fetch, sweeps)
  6. Where do I...? (task index)

Upgrading an existing bot: Upgrading to 3.0 (from 2.x) or Migrating to 2.0 (from 1.x). Coming from discord.js: From discord.js.

Verify it works

From this repo after pnpm install && pnpm run build:

bash
FLUXER_BOT_TOKEN=your_token node examples/minimal-bot.js

Then send !ping in a channel the bot can see. Next stop: the Basic bot guide, or browse examples.

Custom API host

Most bots use the default hosted API. For a custom base URL (legacy):

javascript
const client = new Client({
    rest: { api: process.env.FLUXER_API_URL },
});

For self-hosted discovery and multi-instance setups, see the Multi-instance guide.

Questions?Join the Fluxer community for help with the SDK.Join Fluxer