Fluxerly.js (FluxerlyJS) is a Fluxer-native bot SDK for JavaScript, TypeScript and Effect · fluxerly.neontechspace.com
Home · Docs · Quick start · API reference · Changelog · Examples · FAQ · Agent skill · llms.txt · NeonFlux
npm install @neontechspace/fluxerlyimport { runBot } from "@neontechspace/fluxerly"
await runBot({
token: process.env.FLUXER_BOT_TOKEN,
commands: {
prefix: "!",
commands: { ping: { execute: ({ reply }) => reply("Pong!") } },
},
})The same SDK runs large bots. NeonFlux is a real Fluxer bot using it
Fluxerly is built for developers at every skill level, from a first bot in one file to large production bots that need full control
- One-file start and scaffolding: The
fluxerly initCLI creates a runnable JavaScript, TypeScript or Effect starter with a working test, andrunBotconnects, drains on Ctrl+C and explains failed startups with a fix - Structured, actionable errors: Network calls return a Result instead of throwing silently, every error carries a stable code, an actionable hint, typo suggestions on unknown options and
describeErroroutput witherrors.apiCode,errors.outcomeanderrors.retryAfterMs, while logs mask tokens and recognized credentials automatically - Built-in commands, builders and collectors: Prefix commands with typed arguments, guards, cooldowns, middleware, command groups and generated help, alongside
EmbedBuilder,MessageBuilderand message or reaction collectors - Complete Fluxer coverage: Messages, embeds, attachments, voice notes, reactions, threads and forum posts, communities, roles and permissions, emoji and stickers, webhooks and OAuth2, with paginated history and opt-in bounded caches
- Typed raw escape hatches: The
client.rest.callmethod reaches every bot route with Fluxer's own field names checked at compile time,client.rest.requestreaches routes newer than the SDK, and raw gateway events carry their documented payload types - Zero-network testing: The
/testingand/effect/testingentry points shipcreateTestBotwith an in-memory Fluxer gateway, HTTP server and virtual test clock so timed work runs without waiting - Two APIs, one engine: Start with async/await and Results, or choose the native Effect 4 API with typed error channels, scopes and layers, backed by the same implementation
- Production resilience: Automatic sharding, session resume across restarts, a process supervisor, deadline-aware rate limiting that never blindly replays uncertain writes, and metrics and traces through
observe - Built-in CLI, diagnostics and agent workflow: Shipped TypeScript
src/and source maps,fluxerly doctorfor offline setup andnode_modulesdrift checks,fluxerly triagefor agent-powered root-cause debugging against shipped source withcreateTestBotreproductions,fluxerly agentsforAGENTS.md,SKILL.md, Cursor, Claude and Gemini rules,fluxerly invitefor offline install URLs, plus SKILL.md and llms.txt - Tracked against Fluxer's server: Automated drift checks across Fluxer's API documents and server source trees, verified by offline contract tests, live end-to-end Fluxer checks and multi-model security reviews
The result is less infrastructure to build, with testing, diagnostics and production structure already in place
Fluxer moves fast, and Fluxerly keeps pace. Choose the channel that fits your bot:
- Stable: Releases that passed every check, for bots that value calm
- Nightly: The newest changes as they land, for bots that want them first
Fluxerly is tested against Node.js 26.13 or newer. JavaScript needs no compiler, and TypeScript typechecking or compilation requires TypeScript 7 and @types/node as a development dependency
npm
npm install @neontechspace/fluxerlypnpm
pnpm add @neontechspace/fluxerlyBun
bun add @neontechspace/fluxerlyA committed lockfile records the exact installed version and keeps installs reproducible. Nightly releases can include breaking changes. Install one with
npm install --save-exact @neontechspace/fluxerly@nightly, orbun add --exact @neontechspace/fluxerly@nightlywith Bun, so a fresh install without a lockfile cannot pick up a newer nightly that breaks the API
A bot needs a Fluxer application, its bot token and an invite to a community
Generate a project with a test in the bot's folder with npx @neontechspace/fluxerly init, pnpm dlx @neontechspace/fluxerly init or bunx @neontechspace/fluxerly init, choose JavaScript, TypeScript or Effect, and follow the steps it prints. Adding --template js, --template ts or --template effect skips the question. An existing .env is kept, and missing node_modules and .env lines are added to an existing .gitignore. The quick start also sets up the same project by hand
The generated bot.js replies Pong! to !ping:
import { defineBot, runBot } from "@neontechspace/fluxerly"
// The bot's options without its token, so its test can run them through createTestBot without a token or a network
export const bot = defineBot({
commands: {
prefix: "!",
commands: {
// Returning the reply reports a failed send to the log
ping: { execute: ({ reply }) => reply("Pong!") },
},
},
})
// Running this file starts the bot, while importing it from a test does not.
// A failure that stops the bot, such as a rejected token, is logged and sets a failing exit code
if (import.meta.main) await runBot({ token: process.env.FLUXER_BOT_TOKEN, ...bot })Set FLUXER_BOT_TOKEN in .env, check the bot with npm test and start it with npm start, then send !ping in a channel the bot can read. While changing the bot, npm run dev restarts it after each saved change
Import @neontechspace/fluxerly and use async / await. Check Results for expected failures, and control shutdown with explicit methods and cancellation signals. The default API works with new bots and existing Promise-based applications. JavaScript users do not need TypeScript or Effect setup
Import @neontechspace/fluxerly/effect and compose work with Effect.gen and yield*. Expected failures stay in the typed error channel. Scopes and interruption control cleanup. Choose this API for an Effect application, or to learn structured concurrency with a real bot
Both entry points provide typed events, prefix commands, embeds, attachments, reactions and collectors. Optional bounded caches keep local lookup separate from remote reads
Bots often grow from one handler into several jobs, listeners and requests that must stop together. Effect describes that work as one program, shares its dependencies and waits for scoped cleanup when it succeeds, fails or is interrupted
For example, a scoped conversation can register a collector, send a question and wait for an answer. If sending fails, the scope releases the collector. Concurrent reads can cancel their unfinished siblings on failure without leaving cleanup to scattered callbacks
Learn the core concepts in the Effect v4 introduction
Installing Effect for a native application
Applications that import Effect directly must declare it as a direct dependency, using a version within the installed SDK's peerDependencies.effect range. Read node_modules/@neontechspace/fluxerly/package.json, or the SDK manifest for this checkout
Fluxerly is tested against the lowest version in that range and against its Effect 4 development version, which can be newer. Later Effect 4 releases are accepted. Do not install Effect 3 or an Effect 4 prerelease. The versioned documentation gives the matching install command
Note
Fluxerly waits for Fluxer's new voice system and does not support voice over LiveKit. Fluxer is replacing LiveKit with its own voice system, which should arrive soon, and bot voice will come with it
Fluxerly does not join voice channels or send live audio or video yet. Until then, voice states, member voice controls such as move, mute, deafen and disconnect, voice notes, and audio or video attachments work
Licensed under Apache-2.0

