Skip to main content
Version: 0.0.14

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​

  1. The SDK authenticates with the Sofya API using the provided API key.
  2. The API returns a list of available providers and their configurations.
  3. The SDK attempts to connect to each provider in order until a successful connection is established.
  4. Once connected, the SDK emits a 'ready' event.

Provider-Specific Connection Flow​

  1. The SDK attempts to connect directly to the specified provider using the provided endpoint and configuration.
  2. Once connected, the SDK emits a 'ready' event.