← Recipe: call a server function

3. Create backend/functions.json

generated Luau client · trusted JavaScript handler · about 25 minutes
one versioned query contract

The declaration names the public operation and gives both sides exact typed fields.

When to use it

Create this declaration before generation. Add a new versioned operation instead of silently changing incompatible input or result meaning.

  • authorization: public means no signed-in principal is required; it does not make input trustworthy.
  • mutation: false declares a read-only query, so this operation does not need an idempotency key.
  • clientName becomes greet and decodeGreet in the generated Luau module.

Focused example

{
  "schemaVersion": 1,
  "types": {},
  "functions": {
    "greeting.message.v1": {
      "clientName": "greet",
      "authorization": "public",
      "mutation": false,
      "idempotency": "none",
      "input": { "name": "string" },
      "result": { "message": "string" }
    }
  }
}

Complete inventory

View all pages in Recipe: call a server function
← Previous: 2. Replace luastra.jsonNext: 4. Create backend/handlers.mjs →