# SDKs

> The React SDK, @sommatic/react-sdk, brings Sommatic AI into your web app - services for the API, real-time streams, the Command Center, the workflow canvas and task components.

Source: https://docs.sommatic.ai/en/sdks/ (updated 2026-11-26)

`@sommatic/react-sdk` is the package the Sommatic AI portal itself is built with. With it your React app can read and
change workflows, knowledge and tasks through the API, follow runs and task assignments in real time, embed the
Command Center, and show tasks to the people who must resolve them.

Diagram: One import and one configureSommatic call give your app services for the API, live streams and ready components.

## What is in the package

| Part                                                                     | What you get                                                                                                                                                            |
| ------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Configuration](https://docs.sommatic.ai/en/sdks/react/configuration.md) | `configureSommatic`: one call that points every service and stream at your backend.                                                                                     |
| [Services](https://docs.sommatic.ai/en/sdks/react/services.md)           | One class per API resource (`WorkflowOrchestrationFlowDefinitionService`, `WorkManagementTaskService`…) built on `BaseApi`, plus stream classes for server-sent events. |
| [Components](https://docs.sommatic.ai/en/sdks/react/components.md)       | The Command Center panel, the workflow canvas and its live console, task views, notifications and knowledge editors.                                                    |
| [Hooks](https://docs.sommatic.ai/en/sdks/react/hooks.md)                 | `useCommandCenter`, the `useSommatic*` registration hooks, `useTaskInbox`, `useEventStream`, `useSseConsole` and more.                                                  |

## Install

### Add the package and its peers

```bash
npm install @sommatic/react-sdk @link-loom/react-sdk @veripass/react-sdk luxon @mui/x-date-pickers
```

The SDK runs on React 17, 18 or 19 with React Router 5, 6 or 7. Identity comes from `@veripass/react-sdk`, and shared
interface primitives from `@link-loom/react-sdk`.

### Point it at your backend

```javascript
import { configureSommatic } from '@sommatic/react-sdk';

configureSommatic({ baseUrl: 'https://api.sommatic.ai' });
```

Call it once, before the first render. See [Configuration](https://docs.sommatic.ai/en/sdks/react/configuration.md).

### Use a service

```javascript
import { WorkflowOrchestrationFlowDefinitionService } from '@sommatic/react-sdk';

const service = new WorkflowOrchestrationFlowDefinitionService({ apiKey: token });
const response = await service.getByParameters({ queryselector: 'id', search: 'wf-flow-definition-…' });

if (response?.success) {
  const [definition] = response.result.items;
}
```

> **Note: Same API, same envelope**
>
> Services return the API's response as is: `{ status, success, message, result }`. What you read about
> [conventions](https://docs.sommatic.ai/en/api/conventions.md) and [errors](https://docs.sommatic.ai/en/api/errors.md) applies to every service call.

The package is published on npm as `@sommatic/react-sdk` under the Apache-2.0 license, written in JavaScript with
CommonJS and ES module builds.

## Next steps

- [Configuration](https://docs.sommatic.ai/en/sdks/react/configuration.md): Base URL, tokens and environment variables.
- [Add the Command Center](https://docs.sommatic.ai/en/command-center/integration.md): Providers, commands and operable pages.
