Aero developer docs
Aero developer docs
Build an Aero: an app that lives inside a Nexus, reacts to events, answers commands and acts through the permissions a Nexus owner grants. Your Aero runs wherever you host it and talks to two things: the realtime gateway and the runtime API.
Overview
Three steps to a working Aero:
- Create an Aero in the Developer Portal and copy its token (shown once).
- Declare which events it listens to, and register any slash commands.
- Run your client: connect to the gateway, handle events and commands, and act through the runtime API.
A Nexus owner then installs your Aero and grants it permissions. Your Aero never has more authority than the role those grants create, and every action is checked on the server against it.
Use the SDK (recommended)
The official @ballastra/aero package does the boring parts for you: connecting, re-registering on reconnect, de-duplicating deliveries, and typed helpers. Most Aeros are a few lines with it.
npm install @ballastra/aeroimport { createAero } from '@ballastra/aero';
const aero = await createAero({ token: process.env.AERO_TOKEN });
aero.on('member.joined', async (ev) => {
const m = ev.data.member;
if (m.is_aero) return;
await aero.sendMessage(ev.nexus_id, process.env.WELCOME_SPACE_ID, `Welcome, ${m.name}! 👋`);
});
aero.command('welcome', async (i) => {
await i.reply(`Welcome, ${i.options.name || i.invoker.name}! 👋`); // reply() posts into the space
});Want to see exactly what it does underneath? The rest of these docs describe the raw contract the SDK is built on, which you can also use directly.
Authentication
Every runtime request carries your token in the Authorization header, using the Aero scheme:
Authorization: Aero <your-token>The token is shown once when you create or rotate the Aero. Store it as a secret, such as an environment variable, never in client-side code or a public repo. Rotating it in the portal immediately invalidates the old one.
Where to go next
- Gateway & events: connect and react to what happens in a Nexus.
- Commands & interactions: slash commands, prefix commands and how to answer them.
- Components: embeds, buttons and menus in a message.
- Runtime API: every action and read an Aero can make, plus direct messages.
- Error codes and a full example.