콘텐츠로 이동

Provider

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

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:212

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

"solapi"

readonly name: string

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

Human-readable name for display purposes.

"SOLAPI"

readonly supportedTypes: readonly MessageType[]

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

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

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

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

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

DeliveryStatusQuery

Promise<Result<DeliveryStatusResult | null, KMsgError>>


optional getOnboardingSpec(): ProviderOnboardingSpec

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

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:228

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

Promise<ProviderHealthStatus>


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

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

Send a message through this provider.

SendOptions

Promise<Result<SendResult, KMsgError>>

Result with SendResult on success, KMsgError on failure.