@devias/sdk is the client the studio itself uses. It calls the Devias HTTP API, listens for live changes and provides a query builder. It is written in TypeScript, so every method and record shape is typed.
The SDK lives in the repository as the @devias/sdk workspace package. A package that uses it adds it as a workspace:* dependency.
Create a client
An API key is created in Settings → API keys. A key made there can read records. See Authentication.
createWorkspaceApi with only a baseUrl lists the workspaces a person can open, and creates one.
Areas of the client
Everything hangs off one object, grouped by area.Errors
Every failure is thrown as aDeviasApiError, with a status, a code such as NOT_FOUND or VALIDATION, a message, and sometimes details.
Related
- Records and queries: read and write data.
- Metadata and modules: the schema and module installation.
- Events and notifications: live changes.
- Mock backend: work without a server.