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 β
| Mode | Behavior |
|---|---|
| Development | Regenerated on each backend start (including hot reload) |
| Production | Generated 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.