Skip to main content

Functions

Functions — ɳSelf documentation.

Feature: Functions

ɳSelf includes a serverless runtime for running custom backend logic close to your data.

What’s Included

CapabilityDescription
HTTP triggersRun functions on HTTP requests
Event triggersRespond to Hasura database events
Cron triggersSchedule functions on a cron expression
TypeScript/JavaScriptNode.js runtime

How to Enable

nself service enable functions
nself build && nself restart

Or set in .env:

FUNCTIONS_ENABLED=true

Key Configuration Variables

VariableDescriptionDefault
FUNCTIONS_ENABLEDEnable Functions servicefalse
FUNCTIONS_PORTInternal port3000

Deploying Functions

Place function files in your project’s functions/ directory. ɳSelf mounts this directory into the Functions container automatically.

my-project/
└── functions/
    ├── hello-world.ts
    └── send-email.ts

Functions are available at: https://functions.your-domain.com/v1/{function-name}

Event Triggers

Configure event triggers in the Hasura console or via Hasura migrations to call functions when database rows are inserted, updated, or deleted.

See Also