Connections
Connection Types
The SDK supports different connection modes based on the provider:
API Key Connection
{
apiKey: string;
config?: BaseConfig;
}
Sofya Compliance Provider Connection
{
provider: "sofya_compliance";
endpoint: string;
config: SofyaComplianceConfig;
}
Sofya As Service Provider Connection
{
provider: "sofya_as_service";
endpoint: string;
config: SofyaSpeechConfig;
}
Configuration Types
BaseConfig
interface BaseConfig {
language: string;
}
SofyaComplianceConfig
interface SofyaComplianceConfig extends BaseConfig {
token: string;
compartmentId: string;
region: string;
}
SofyaSpeechConfig
interface SofyaSpeechConfig extends BaseConfig {}
Connection Flow
API Key Connection Flow
- The SDK authenticates with the Sofya API using the provided API key.
- The API returns a list of available providers and their configurations.
- The SDK attempts to connect to each provider in order until a successful connection is established.
- Once connected, the SDK emits a 'ready' event.
Provider-Specific Connection Flow
- The SDK attempts to connect directly to the specified provider using the provided endpoint and configuration.
- Once connected, the SDK emits a 'ready' event.