diff --git a/src/channels/adapter.ts b/src/channels/adapter.ts index 4d18a0e..1ae34bc 100644 --- a/src/channels/adapter.ts +++ b/src/channels/adapter.ts @@ -97,7 +97,7 @@ export interface ChannelAdapter { } /** Factory function that creates a channel adapter (returns null if credentials missing). */ -export type ChannelAdapterFactory = () => ChannelAdapter | null; +export type ChannelAdapterFactory = () => ChannelAdapter | Promise | null; /** Registration entry for a channel adapter. */ export interface ChannelRegistration { diff --git a/src/channels/channel-registry.ts b/src/channels/channel-registry.ts index a2981a6..7778cfd 100644 --- a/src/channels/channel-registry.ts +++ b/src/channels/channel-registry.ts @@ -47,7 +47,7 @@ export function getChannelContainerConfig(name: string): ChannelRegistration['co export async function initChannelAdapters(setupFn: (adapter: ChannelAdapter) => ChannelSetup): Promise { for (const [name, registration] of registry) { try { - const adapter = registration.factory(); + const adapter = await registration.factory(); if (!adapter) { log.warn('Channel credentials missing, skipping', { channel: name }); continue;