Hidding Sentry Auth fom app.json


For anybody who wants to hide sentry auth token from app.json, you just need to make it and env variable.

I just created an bash script to inject it and changed the package.json scripts to run it before calling expo start, build, etc, and it seems to work…



#!/usr/bin/env bash

export SENTRY_AUTH_TOKEN="token"


  "scripts": {
    "start": ". ./setEnv.sh && expo start",
    "build-android": ". ./setEnv.sh && expo build:android",
... rest of the file ...

reference: https://github.com/expo/sentry-expo/issues/29


Thanks for sharing this @naripok!


Hey guys, I have a question…

Although the method described above seems to work for injecting the sentry token into app.json (sentry works fine, does it works even without the token?), when I try to access any env variables via process.env.VARIABLE_NAME from inside my app, I get undefined value…

Which method do you guys recommend for injecting env variables into an expo app, e.g. for alternating between dev and prod configs?

Thanks in advance!