On this page
Create and Use MiniUp Functions
A MiniUp Function runs server-side JavaScript when an HTTP request arrives. Use a Function to validate input, enforce member permissions, transform data, or call services using private credentials.
Choose a Function workflow
- Open API: publish a Public Function for data or logic that anyone may call.
- Trusted integration: protect a Function with an API Key and call it from a trusted server.
- Paid API (optional): enable x402 payments alongside any access setting and charge compatible callers per successful request.
- Authenticated app: link a Site Members Function to one MiniUp Site and use the Site’s members and roles.
| Mode | Best for | Browser secret needed |
|---|---|---|
| Public | Open APIs | No |
| API Key | Trusted external/server calls | Yes — caller needs a key; keep it out of browsers |
| Site Members | Authenticated MiniUp apps | No |
| x402 Paid | Optional payment per successful request | No Function key; an x402-compatible client satisfies payment |
Create your first Function
- Open Functions in the main navigation and choose New Function.
- Enter a display name and globally unique stable slug.
- Write a JavaScript request handler in Code and save the draft.
- Use Test to run a preview request, inspect the result, and repair errors.
- Configure access, methods, and any Secrets.
- Select Publish and test the resulting endpoint in its intended calling context.
Start with the step-by-step Function guide and its minimal handler.
What belongs in a Function?
Functions handle requests and return responses. Keep frontend files in the Site and persistent application records in a Table or service. Do not treat a Function’s in-memory variables as a persistent database. Use browser-safe code for the frontend and a standard JavaScript fetch handler for Function code.
Review availability and usage
Open Functions to see your Function count, API calls this month, remaining calls, and reset date. Account allowances and feature availability can differ. Check Plans and your signed-in usage before depending on a particular limit. Understand limits and usage →