AICord Applets
Welcome to the AICord Applet System! Applets are tiny JavaScript tools that let your AI characters do powerful things - like pulling live data, reacting to server events, or integrating with external services. No big setup, no bloated codebase - just one file of code, one idea.
Applets let your characters do real-world tasks: call APIs, fetch data, trigger webhooks giving them agentic capabilities beyond just conversation.
What’s an Applet?
An applet is a simple JavaScript code in AICord's Applet Editor that contains one or more named functions. AICord runs them in a safe sandbox and invokes the appropriate one based on context (like a user message, or Discord event).
Think of applets like "mini apps" your characters can use. They're plug-and-play extensions of their minds.
How to code an applet?
In this tutorial, we are going to create an applet that allows AI characters to get the weather of a city when needed.
To manage applets installed to your Discord server, go to the AICord Dashboard, then click the Applets menu on the sidebar.
You'll be able to see 2 sections for applets:
Discover: Browse and install public applets made by other AICord users
Installed: The applets you either created or installed from Discover tab
You'll be only able to modify code of your own applets. In case of installed public applets, you can only modify its secrets.
Now click on the
button, which will create a new applet and lead you straight to the Applet Editor:

This interface might seem scary at first, but for now let's just get to know the essential areas & tabs on the top and walk through setting up our weather applet!
Code

Here you can write your applet code in exported JS functions. The most important thing to make your applet work is to export a function named run like this:
Applets work like this: An user asks the character for current weather. The character looks for available applets it has access to, and checks their manifest to see what data applets are waiting for. After this, the character decides to call the weather applet's run function which does its own logic and returns a string with the result in a way that the character understands it. Then, the character will use this result and respond to the user.
For our weather applet, let's use this code for now. I'll explain its details later.
Manifest
This tab and field stores your applet input configuration and metadata. This JSON structure contains these fields mainly:
name
Defines the name of your applet
string
description
Defines the description of your applet
string
visibility
This field stores whether your applet is public (visible to all AICord users) or private
string, can only be "public" or "private"
input
This contains the data structure of the inputs so the characters know what parameters to call your applet with
any (can be string or object)
triggers
Shows which events your applets support
list of strings
Here's a simple manifest for our weather applet:
Notice that we added an object to input with the name of the field (in our case city) and it's data type which is string
When the character will try to call our applet to get the weather in a specific city (now let's say Budapest), it will send this object to your applet:
So the applet's run function will get this data as the value of its input argument:
Or you could "unbox" input values like this for your weather applet for easier access:

Test
In this section, you can test whether or not your applet works and does its job. You just need to add a JSON structure acting as if you were the character yourself and passed the data to the applet:
Once data is added, click Run Test. The test output panel on the right side will show the output if applet call was successful or an error if not:

⚡ Supported Functions
Each function gets the inputs as one input param, and you need to unbox it.
run(input)
This is the default function. AI uses the applet as a tool (for example when user asks about weather)
Anything your applet requires
onGuildMemberAdd({user})
A user joins the server
Discord user object within user value
More coming soon! Suggest new events on our Discord server!
Agentic AI + Applets = Magic
Applets power your AI characters to interact with the world. With applets, they can:
Fetch stock prices
Call APIs like OpenWeather or HuggingFace
Send Discord messages
React to users joining
Access user-provided secrets (API keys)
It’s like giving your AI a Swiss Army knife, and you control what tools it gets.
Using Secrets
Add placeholders like:
When run, AICord will inject the actual secret. You keep your code clean and safe. Secrets for applets can be defined on AICord Dashboard.
If your applet is public and someone clones it, they will need to add their own API keys so not yours is used.
Never hardcode your actual secrets & keys into the code directly!!!
✅ What’s Allowed in Applets
Since Applets are executed as serverless functions in a safe container, there are some limitations. AICord Team is always working on extending these to allow you to use truly anything!
✅
fetch()— Make external API calls✅
console.log()— Logs visible in your dashboard✅ Use
export functionstyle syntax✅ Use multiple named exports
✅ AICord passes some common and popular modules to your code automatically without you having to import them. You can suggest modules in Discord server.
🚫 3rd party
import/require— Not supported (yet!)🚫
fsor file system access🚫 Long-running code (>60s timeout)
Note: You can still expose helper functions within your file and AICord will run it in a controlled Node.js VM with specific permissions you configure.
🌤 Sample Applet: Weather

How Applets Work Behind the Scenes
Events are dynamically routed. If your applet exports onGuildMemberAdd, it runs only when a user joins.
AICord has a GitHub repo with applet examples & templates here
Last updated