Possible to see release channel in app.config.ts?

I read this:

But is there a way to view the release channel of the app to change the app config variables?

Seems like it only works if you put something in the ENV variables of the machine.

Hey @tennisbum, leveraging env vars will be the best course of action here. The release channel isn’t exposed in app.json or app.config.*.

Cheers,
Adam

@adamjnav

It’s kind of strange because we can access the release-channel in the app to do custom logic but not for config.

Is there any way to have a different config for FirebaseAnalytics - Expo Documentation based on the release channel?

That’s essentially my problem. My understanding is that it pulls in the config from app.json and there is no way to overwrite it (assuming you don’t use FirebaseAnalyticsJS)

I want to have a production project only in firebase to keep the data separate, which is probably a pretty common problem.

Are there any downsides to just using the Firebase AnalyticsJS and handling the config in the app?

you can use an env var for this instead. ENV=production expo publish --release-channel prod - that sort of thing. then read process.env inside of app.config.js

@notbrent got it, thanks.

I guess my problem with this approach is:

It’s redundant and that leads to it being error prone and easily missed. We are now essentially determining “production” mode in two ways, from the naming of the release channel and the environment variables. Seems like more overhead for deployment and more things that can go wrong.

You now have to introduce a new environment variable for really just one reason which adds more weight to your deployment and is easily missed.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.