DOCUMENTATION / QUICKSTART
A first bot, a fresh possibility.
Create an application, invite it into a test community, and make your first command respond.
Download SDK v1.0.01. Create your application
Sign in to the developer console using your existing Relay account. Create a developer team and an application. Set its name, avatar and cover, then choose the permissions it needs. For this example, select View Channels, Send Messages, and Use Commands.
Create a token in Credentials. The full token is shown once. Save it in your server’s secret manager or an environment variable. Relay stores its hash, and you can revoke it at any time.
2. Install it in a community
Copy the invitation from Distribution and open it in Relay. Choose a community where you have Manage Community permission, review the grants, select the channels, and approve the installation. A bot does not automatically gain access to every channel.
3. Build the SDK from source
The SDK is available as a downloadable package from this portal. It is not published to npm yet. Use Node.js 22 or newer. You can also build it from the source repository if you have access.
mkdir relay-bot && cd relay-bot
npm init -y
npm install https://relaydev.pullup.at/downloads/relaychat-sdk-1.0.0.tgz4. Start the conversation
Run your script on a server or your computer. Open Bot commands in the granted Relay channel and choose /hello. The reply is private to the person who ran the command by default.
import { RelayClient, SlashCommandBuilder } from '@relaychat/sdk';
const bot = new RelayClient({ token: process.env.RELAY_BOT_TOKEN });
bot.on('interactionCreate', async interaction => {
if (interaction.commandName === 'hello') {
await interaction.reply('Hello! Welcome to our corner of Relay.');
}
});
bot.on('error', error => console.error(error.message));
await bot.commands.set([new SlashCommandBuilder()
.setName('hello').setDescription('Say hello')]);
await bot.start();
process.once('SIGINT', () => void bot.stop());5. Make it yours
Try an interactive message, a private support ticket, or a verification form. The SDK wraps the documented REST API; any language that can make HTTPS requests can build a Relay bot.
relay