Skip to content

How to use β€” generated-config.ts ​

When your plugin has a backend, raclette writes frontend/generated-config.ts. That file defines how $data calls your API and which socket channels belong to each operation.

Do not edit it by hand.

When it is updated ​

ModeBehavior
DevelopmentRegenerated on each backend start (including hot reload)
ProductionGenerated at build; not changed at runtime

More detail: Backend overview β€” lifecycle Β· FAQ.

How you use it in widgets ​

Registration merges operations into usePluginApi().$data automatically:

typescript
const { $data } = usePluginApi()
const { data, execute, isLoading } = $data.todo.getAll({
  options: { immediate: true },
})

Operation names match backend route registration (for example getAll, create, update). Rules: Frontend entity mapping (backend).

When to add data in index.ts ​

Only if:

  • the plugin has no backend, or
  • you need extra client operations not on any route.

Otherwise omit the data block in defineRaclettePluginFrontend.

See also ​