diff --git a/src/index.ts b/src/index.ts index 8ff50f5..b1e3206 100644 --- a/src/index.ts +++ b/src/index.ts @@ -388,7 +388,16 @@ export async function init(config: IClientConfig): Promise { skipInitialPoll: skipInitialRequest, }; instance.setConfigurationRequestParameters(requestConfiguration); - instance.setEventDispatcher(newEventDispatcher(apiKey)); + + // e.g. newDefaultEventDispatcher throws an error if it cannot parse a valid event ingestion URL from the SDK key + try { + instance.setEventDispatcher(newEventDispatcher(apiKey)); + } catch (eventDispatcherError) { + applicationLogger.warn( + 'Eppo SDK encountered an error initializing the event dispatcher, continuing initialization', + eventDispatcherError, + ); + } // We have two at-bats for initialization: from the configuration store and from fetching // We can resolve the initialization promise as soon as either one succeeds