KMsgRoutingConfig
Defined in: packages/messaging/src/k-msg.ts:67
Configuration for routing messages to specific providers.
Controls how KMsg selects which provider to use for each message type.
Routing is resolved in this order: explicit providerId > byType mapping >
defaultProviderId > first provider that supports the message type.
Example
Section titled “Example”const routing: KMsgRoutingConfig = { defaultProviderId: 'solapi', byType: { ALIMTALK: 'iwinv', SMS: ['solapi', 'iwinv'], }, strategy: 'round_robin',};Properties
Section titled “Properties”byType?
Section titled “byType?”
optionalbyType?:Partial<Record<MessageType,string|string[]>>
Defined in: packages/messaging/src/k-msg.ts:73
Map of message types to provider IDs.
Can be a single provider ID or an array for load balancing.
When an array is provided, the strategy determines which provider is selected.
defaultProviderId?
Section titled “defaultProviderId?”
optionaldefaultProviderId?:string
Defined in: packages/messaging/src/k-msg.ts:79
Default provider ID to use when no type-specific routing is configured
and no explicit providerId is provided in the send options.
strategy?
Section titled “strategy?”
optionalstrategy?:RoutingStrategy
Defined in: packages/messaging/src/k-msg.ts:85
Strategy for selecting from multiple providers when byType contains an array.
Default
Section titled “Default”"first"