Skip to content

About

The JavaScript SDK for Fluxer bots, built for clear APIs, approachable docs, and long-term maintainability

Topics

Resources

Contributing

Security policy

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

305 Commits

Folders and files

Repository files navigation

Fluxerly.js, a Fluxer-native bot SDK. A few lines of bot code and the conductor mascot answering Pong!

Fluxerly.js

From your first reply to the bot of your dreams

Fluxerly.js (FluxerlyJS) is a Fluxer-native bot SDK for JavaScript, TypeScript and Effect · fluxerly.neontechspace.com

Open GitHub issues Open GitHub pull requests GitHub forks GitHub stars

npm version OSS Insight: Repository analytics Community: Public invite coming soon

Home · Docs · Quick start · API reference · Changelog · Examples · FAQ · Agent skill · llms.txt · NeonFlux

npm install @neontechspace/fluxerly
import { runBot } from "@neontechspace/fluxerly"

await runBot({
    token: process.env.FLUXER_BOT_TOKEN,
    commands: {
        prefix: "!",
        commands: { ping: { execute: ({ reply }) => reply("Pong!") } },
    },
})

A terminal runs fluxerly init and npm start, then in a chat !ping gets the reply Pong!

The same SDK runs large bots. NeonFlux is a real Fluxer bot using it

What Fluxerly includes

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 init CLI creates a runnable JavaScript, TypeScript or Effect starter with a working test, and runBot connects, 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 describeError output with errors.apiCode, errors.outcome and errors.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, MessageBuilder and 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.call method reaches every bot route with Fluxer's own field names checked at compile time, client.rest.request reaches routes newer than the SDK, and raw gateway events carry their documented payload types
  • Zero-network testing: The /testing and /effect/testing entry points ship createTestBot with 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 doctor for offline setup and node_modules drift checks, fluxerly triage for agent-powered root-cause debugging against shipped source with createTestBot reproductions, fluxerly agents for AGENTS.md, SKILL.md, Cursor, Claude and Gemini rules, fluxerly invite for 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

Install

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/fluxerly

pnpm

pnpm add @neontechspace/fluxerly

Bun

bun add @neontechspace/fluxerly

A 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, or bun add --exact @neontechspace/fluxerly@nightly with Bun, so a fresh install without a lockfile cannot pick up a newer nightly that breaks the API

Getting started

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

Choosing an API

JavaScript & TypeScript

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

Effect

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

Why learn Effect?

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

Voice: Waiting for Fluxer's new voice system

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

Repository activity

Repobeats analytics

Fluxerly.js star history

Fluxerly.js downloads over the last 365 days, grouped by week

Licensed under Apache-2.0

About

The JavaScript SDK for Fluxer bots, built for clear APIs, approachable docs, and long-term maintainability

Topics

Resources

Contributing

Security policy

Stars

4 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages