← Recipe: call a server function

2. Replace luastra.json

generated Luau client · trusted JavaScript handler · about 25 minutes
rpc.call + generated module + backend files

The manifest declares the capability, trusted files, generated client path, and dependency edge explicitly.

When to use it

Replace the generated manifest. rpc.call is required for Server calls; ui.render remains required for the visible application.

Focused example

{
  "schemaVersion": 2,
  "project": { "id": "dev.luastra.server-recipe", "entry": "app/main" },
  "sdk": { "contract": 1 },
  "capabilities": ["rpc.call", "ui.render"],
  "backend": {
    "declaration": "backend/functions.json",
    "handler": "backend/handlers.mjs",
    "generatedClient": "src/generated/server-functions.luau",
    "generatedModule": "app/server-functions"
  },
  "modules": [
    {
      "id": "app/main",
      "source": "src/main.luau",
      "dependencies": ["app/server-functions", "luastra/app", "luastra/ui"]
    },
    {
      "id": "app/server-functions",
      "source": "src/generated/server-functions.luau",
      "dependencies": ["luastra/server"]
    },
    {
      "id": "app/tests/server",
      "source": "tests/smoke.luau",
      "dependencies": ["app/main", "app/server-functions"]
    }
  ],
  "tests": ["app/tests/server"]
}

Complete inventory

View all pages in Recipe: call a server function
← Previous: 1. Create the projectNext: 3. Create backend/functions.json →