Skip to content

Provider

Defined in: packages/core/src/provider.ts:235

Core provider interface for sending messages.

All providers must implement this interface. Optional capabilities (balance, templates, delivery status) are exposed via separate interfaces.

class MyProvider implements Provider {
readonly id = "my-provider";
readonly name = "My Provider";
readonly supportedTypes = ["SMS", "LMS"] as const;
async healthCheck() { return { healthy: true, issues: [] }; }
async send(params) { ... }
}

readonly id: string

Defined in: packages/core/src/provider.ts:241

Unique identifier for this provider instance. Used for routing and logging.

"solapi"

readonly name: string

Defined in: packages/core/src/provider.ts:246

Human-readable name for display purposes.

"SOLAPI"

readonly supportedTypes: readonly MessageType[]

Defined in: packages/core/src/provider.ts:251

Message types this provider supports. Messages of unsupported types will be rejected.


readonly optional transportCapabilities?: ProviderTransportCapabilities

Defined in: packages/core/src/provider.ts:256

Per-operation transport features supported by this provider. Missing declarations must be treated as unsupported.

optional getDeliveryStatus(query, context?): Promise<Result<DeliveryStatusResult | null, KMsgError>>

Defined in: packages/core/src/provider.ts:275

Query delivery status for a previously sent message. Optional capability - not all providers support this.

DeliveryStatusQuery

ProviderRequestContext

Promise<Result<DeliveryStatusResult | null, KMsgError>>


optional getOnboardingSpec(): ProviderOnboardingSpec

Defined in: packages/core/src/provider.ts:283

Get the onboarding specification for this provider. Used by tooling to guide provider configuration.

ProviderOnboardingSpec


healthCheck(): Promise<ProviderHealthStatus>

Defined in: packages/core/src/provider.ts:262

Check if the provider is operational. Used for health monitoring and circuit breaker decisions.

Promise<ProviderHealthStatus>


send(params, context?): Promise<Result<SendResult, KMsgError>>

Defined in: packages/core/src/provider.ts:267

Send a message through this provider.

SendOptions

ProviderRequestContext

Promise<Result<SendResult, KMsgError>>

Result with SendResult on success, KMsgError on failure.