Skip to content

Instantly share code, notes, and snippets.

@jackabox
Created June 28, 2018 13:12
Show Gist options
  • Save jackabox/1c4e0165a670c38af722e87ec9aa8f89 to your computer and use it in GitHub Desktop.
Save jackabox/1c4e0165a670c38af722e87ec9aa8f89 to your computer and use it in GitHub Desktop.
firebase switch config based on env
const prodConfig = {
apiKey: YOUR_API_KEY,
authDomain: YOUR_AUTH_DOMAIN,
databaseURL: YOUR_DATABASE_URL,
projectId: YOUR_PROJECT_ID,
storageBucket: '',
messagingSenderId: YOUR_MESSAGING_SENDER_ID,
}
const devConfig = {
apiKey: YOUR_API_KEY,
authDomain: YOUR_AUTH_DOMAIN,
databaseURL: YOUR_DATABASE_URL,
projectId: YOUR_PROJECT_ID,
storageBucket: '',
messagingSenderId: YOUR_MESSAGING_SENDER_ID,
}
const config = process.env.NODE_ENV === 'production'
? prodConfig
: devConfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment