Core init config
OrgaAI.init(config) is the entry point for configuring the Orga client runtime. It lives in @orga-ai/core, which you do not normally install yourself: the React, React Native, and Widget SDKs depend on it and call init() when you set up your app (e.g. in a provider or initWidget()). This page documents the config object so you know what you can pass.
Where init runs
| SDK | How config is passed |
|---|---|
| React | You call OrgaAI.init({ ... }) (from @orga-ai/react) before rendering <OrgaAIProvider>. |
| React Native | Same: OrgaAI.init({ ... }) from @orga-ai/react-native in your app bootstrap. |
| Widget | initWidget({ ... }) forwards session/voice/log options into OrgaAI.init() internally. |
| Core only | If you use @orga-ai/core directly (e.g. custom adapter), you call OrgaAI.init(config) yourself. |
OrgaAI.init(config)
Stores global defaults used for session creation, logging, and credential fetching. Call once before starting any session.
import { OrgaAI } from '@orga-ai/react'; // or @orga-ai/react-native, or @orga-ai/core
OrgaAI.init({
fetchSessionConfig: async () => { /* ... */ },
logLevel: 'info',
model: 'orga-1-beta',
voice: 'SofĂa',
});Config object (OrgaAIConfig)
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
fetchSessionConfig | () => Promise<{ ephemeralToken: string; iceServers: RTCIceServer[] }> | Yes1 | — | Async function that returns ephemeral token and ICE servers. Typically calls your backend; never put API keys in client code. |
sessionConfigEndpoint | string | No | undefined | Human-readable endpoint label used in logs and error messages (e.g. "https://api.example.com/orga-session"). Does not trigger requests. |
logLevel | 'disabled' | 'error' | 'warn' | 'info' | 'debug' | No | 'info' | SDK logging verbosity. Use 'debug' during development to inspect WebRTC and session flow. |
model | OrgaAIModel | No | 'orga-1-beta' | Default AI model for new sessions. See Models. |
voice | OrgaAIVoice | No | 'SofĂa' | Default voice for synthesized audio. See Voices. |
temperature | number | No | 0.7 | Default sampling temperature for model responses (0–1). |
enableTranscriptions | boolean | No | true | Whether to request transcriptions for user and assistant turns in the session. |
Either fetchSessionConfig or a backend that the SDK can call must be provided; in practice all client setups use fetchSessionConfig to keep credentials server-side.
Other methods
| Method | Return | Description |
|---|---|---|
OrgaAI.getConfig() | OrgaAIConfig | null | Returns the current config passed to init(), or null if not initialized. |
OrgaAI.isInitialized() | boolean | Whether init() has been called. |
Relation to Node SDK config
The Node SDK (@orga-ai/node) uses a different config type, also named OrgaAIConfig, for its server-side OrgaAI class: it includes apiKey, baseUrl, timeout, and debug. That type is documented under Node SDK types. The table above describes only the client config used by OrgaAI.init() from @orga-ai/core.
Related
- Core SDK overview – What core provides and how adapters use it.
- React SDK / React Native / Widget – Where you typically pass this config in practice.