Also available: Markdown version · llms.txt · full site content
Functions
Function templates
Eight versioned starting points with working code, preselected triggers and security defaults, and step-by-step setup instructions. Everything they generate is editable.
The catalog
| Template | Trigger | What it does | Required secrets |
|---|---|---|---|
| Hello World | HTTP | JSON greeting; the smallest possible function | — |
| Stripe Webhook | HTTP (public, custom signature) | Verifies Stripe-Signature on the raw body; idempotent payment/subscription handling | STRIPE_WEBHOOK_SECRET (STRIPE_SECRET_KEY optional) |
| GitHub Webhook | HTTP (public, custom signature) | Verifies X-Hub-Signature-256 for push and issue events | GITHUB_WEBHOOK_SECRET |
| Send Email | HTTP (API key) or Database | Transactional email through the Resend API | RESEND_API_KEY + EMAIL_FROM variable |
| OpenAI Proxy | HTTP (JWT) | Server-side OpenAI calls so your key never ships to browsers | OPENAI_API_KEY |
| Image Processing | Storage | Processes new uploads, writes derivatives to a separate prefix | — |
| Database Change Handler | Database | Audit logging for INSERT/UPDATE/DELETE, deduped on eventId | — |
| Scheduled Cleanup | Scheduled | Nightly removal of expired rows; edit to your schema | — |
In the Console, Functions → Templates shows the catalog with code previews. “Use template” preselects the trigger type, authentication mode, signature mode, timeout and memory, and walks you through the required secrets and external configuration.
Stripe Webhook, end to end
Create from the template
The function is created with public authentication and custom signature mode — Stripe cannot send a CubiBase JWT, and no CubiBase HMAC is forced on it.
Create the dedupe table
CREATE TABLE stripe_events (id text PRIMARY KEY, type text, processed_at timestamptz); — the handler records every processed event id.
Deploy and copy the URL
The function URL is https://{slug}.api.cubibase.com/functions/{name}. Deploy first; the endpoint is live only after a successful deployment.
Configure Stripe
Stripe Dashboard → Developers → Webhooks → Add endpoint. Paste the URL; subscribe to payment_intent.succeeded and customer.subscription.deleted (or your events).
Store the signing secret
Copy the endpoint’s signing secret (whsec_…) into the STRIPE_WEBHOOK_SECRET secret and redeploy. Optionally set STRIPE_SECRET_KEY to use the official SDK verification path.
Verify with a test event
Send a test event from the Dashboard and check Executions & Logs. The integration is connected only when a signed test delivery succeeds — the Console never claims otherwise.