Environment variables are encrypted and securely deployed with your function.
No environment variables configured
Add your first secret to get started
Danger Zone
Delete Function
Once you delete a function, it will no longer be accessible.
This action cannot be undone immediately, though the function
name will become available for reuse.
Change Function Visibility
This will make your function private. Only you will be able to view and execute it.
Are you sure you want to continue?
Delete Environment Variable
Are you sure you want to delete the environment variable ?
This action cannot be undone.
Delete Function
Are you sure you want to delete the function send-discord-message?
This action cannot be undone. All data will be permanently lost.
Allow external applications to call your function via HTTP
/run/david/send-discord-message
Email Trigger
Execute your function when an email is sent to a unique address
Schedule (CRON)
Execute your function on a recurring schedule
Direct MCP Tool
When enabled, this function is exposed as a dedicated MCP tool in your MicroFn MCP server. The tool name is derived from the function name.
Tool name: fn_send-discord-message
Add Module - send-discord-message
Browse and add MicroFn modules to your function
@microfn/kv
Store and retrieve data that persists across function executions. Perfect for caching, user preferences, session data, and any state that needs to survive between runs.
Import statement:
import kv from "@microfn/kv";
Example:
// Store user preferences
await kv.set("user:123:prefs", { theme: "dark", language: "en" });
// Retrieve cached data
const prefs = await kv.get("user:123:prefs");
@microfn/secret
Access secrets and environment variables configured in your workspace. Retrieve API keys, tokens, database credentials, and other sensitive configuration values.
Import statement:
import secret from "@microfn/secret";
Example:
// Get API key
const apiKey = await secret.get("OPENAI_API_KEY");
// Get required secret (throws if not found)
const dbUrl = await secret.getRequired("DATABASE_URL");
@microfn/fn
Call other functions in your workspace. Build composable workflows by chaining multiple functions together.
Import statement:
import fn from "@microfn/fn";
Example:
// Call a function to send email
const result = await fn.executeFunction("username/send-welcome-email", {
email: "[email protected]"
});
// Chain multiple functions
await fn.executeFunction("username/process-payment", { amount: 99.99 });
await fn.executeFunction("username/send-receipt", { orderId: "12345" });
Describe your edit
Press
Enter
to submit
Waiting for current editor code...
Remix Function
Are you sure you want to remix this function?
Source:
david/send-discord-message
New function:
Code Updated
Function code has been updated externally. Load the new version? Your unsaved changes will be lost.