How to avoid hardcoded API keys in AppDelegate.swift with @intercom/intercom-react-native plugin using expo? | Community
Skip to main content

Hi team,

I'm using @intercom/intercom-react-native with Expo bare workflow and the plugin is generating hardcoded API keys in my AppDelegate.swift

 

Is there a proper way to configure the plugin to use environment variables at runtime rather than hardcoding them during build? I want to avoid committing secrets to my repository.

Thanks!

Hey ​@Alexis Andre 👋 Jacques here from Intercom Support. I hope all is well today!

The Intercom React Native Expo plugin requires API keys to be set at build time, not at runtime. The recommended approach is to use environment variables in your build process (e.g., in app.config.js) so secrets aren’t committed to your repo, but these keys will still be embedded in the built app’s native code.

There’s no official support for loading Intercom API keys from environment variables at runtime. For true runtime secret loading, you’d need to customize your native code, which isn’t supported out of the box.

Hope this helps!