Configuration
Point the React SDK at your backend with configureSommatic, send a Veripass token with each service, and tune timeouts and debug logs.
The SDK needs to know one thing before it can talk to Sommatic AI: where to send its requests. Everything else (tokens, timeouts) is set per service instance.
Set the base URL
// main.jsx
import { configureSommatic } from '@sommatic/react-sdk';
configureSommatic({ baseUrl: 'https://api.sommatic.ai' });
createRoot(document.getElementById('root')).render(<App />);configureSommatic({ baseUrl }) points every service and stream of the SDK at that address. Use the Sommatic AI API,
or a backend of yours that forwards requests to it.
Call it once, before the first render. Each service reads the base URL when it is created, so a service created before the call keeps the old value.
| Situation | Base URL used |
|---|---|
configureSommatic({ baseUrl }) was called | That baseUrl. |
| It was not called | import.meta.env.VITE_APP_BACKEND_URL from your Vite build. |
| Neither is set | An empty string: requests go to your app’s own origin. |
resolveSommaticBaseUrl() returns the value currently in use, useful when you build your own requests next to the SDK.
Send a token
Services send Authorization: Bearer <token> when you create them with an apiKey:
import { WorkManagementTaskService } from '@sommatic/react-sdk';
const tasks = new WorkManagementTaskService({ apiKey: accessToken });
const inbox = await tasks.getByParameters({ queryselector: 'inbox', user_id: userIdentity, page: 1, pageSize: 25 });The token is the one Veripass issues for your organization; see Authentication. The
helpers fetchEntityCollection, createEntityRecord, updateEntityRecord and deleteEntityRecord take the same
apiKey and pass it to the service they instantiate.
Timeouts
Each service accepts settings with a timeout in milliseconds. The default is 31,000 ms; the Git Sync service uses
180,000 ms because a preview or an apply can take longer.
const definitions = new WorkflowOrchestrationFlowDefinitionService({ apiKey: accessToken, settings: { timeout: 60000 } });When a create, update, delete or post times out, the service does not throw: it returns
{ success: false, isTimeout: true, message, code }.
Debug logs of the Command Center
Set VITE_COMMAND_CENTER_DEBUG=true in your development environment to log every plan the Command Center receives and
every step it runs in the browser console.