Functions
Serverless functions let you add server-side logic without having your own server. For example, online payments, sending SMS, or anything else that needs server-side code.
Ready Templates
0xMinds has ready templates that simplify common tasks:
| Template | Use case |
|---|---|
| Online Payment | Connect to payment gateways |
| SMS Sending | Send SMS to users |
| Telegram Bot | Create a Telegram bot |
| Send automated emails | |
| Webhook | Receive data from external services |
Activating a Template
- Select a template from the list
- Enter required settings:
- Service API Key
- Template-specific settings
- Choose a name for the function
- Click "Activate"
Trigger Types
Each function has a trigger that determines when it runs:
HTTP
Function is called with an HTTP request:
POST https://api.0xminds.com/functions/your-function-name
Use case: When you want to call the function from frontend or external service.
Schedule
Function runs automatically at specified times:
- Every hour
- Every day
- Every week
- Or custom time (Cron)
Use case: Sending daily reports, cleaning old data
Database
Function runs when there's a database change:
- When a new row is added
- When a row is edited
- When a row is deleted
Use case: Send notification when a new order is placed
Logs
In the Logs section you'll see function execution history:
| Column | Description |
|---|---|
| Time | When it ran |
| Status | Success or error |
| Duration | How long it took |
| Input | What data it received |
| Output | What data it returned |
Debugging
If a function errors:
- Check the logs
- Read the error message
- Check the input
- Check settings (like API Key)
Important Notes
Tip
- Each function execution uses energy
- Only enable scheduled functions when needed
- Check logs regularly
Security
- Never put API Keys in frontend code
- Protect sensitive functions with authentication