Files
imexmobile/env.js
2023-08-17 11:40:23 -07:00

63 lines
2.1 KiB
JavaScript

import * as Updates from "expo-updates";
const ENV = {
test: {
API_URL: "https://api.test.imex.online",
uri: "https://db.test.bodyshop.app/v1/graphql",
wsuri: "wss://db.test.bodyshop.app/v1/graphql",
REACT_APP_CLOUDINARY_ENDPOINT_API:
"https://api.cloudinary.com/v1_1/bodyshop",
REACT_APP_CLOUDINARY_ENDPOINT: "https://res.cloudinary.com/bodyshop",
REACT_APP_CLOUDINARY_API_KEY: "473322739956866",
REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS: "c_fill,h_250,w_250",
firebase: {
apiKey: "AIzaSyBw7_GTy7GtQyfkIRPVrWHEGKfcqeyXw0c",
authDomain: "imex-test.firebaseapp.com",
projectId: "imex-test",
storageBucket: "imex-test.appspot.com",
messagingSenderId: "991923618608",
appId: "1:991923618608:web:633437569cdad78299bef5",
measurementId: "G-TW0XLZEH18",
},
},
prod: {
API_URL: "https://api.romeonline.io",
uri: "https://db.romeonline.io/v1/graphql",
wsuri: "wss://db.romeonline.io/v1/graphql",
REACT_APP_CLOUDINARY_ENDPOINT_API:
"https://api.cloudinary.com/v1_1/bodyshop",
REACT_APP_CLOUDINARY_ENDPOINT: "https://res.cloudinary.com/bodyshop",
REACT_APP_CLOUDINARY_API_KEY: "473322739956866",
REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS: "c_fill,h_250,w_250",
firebase: {
apiKey: "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE",
authDomain: "rome-prod-1.firebaseapp.com",
projectId: "rome-prod-1",
storageBucket: "rome-prod-1.appspot.com",
messagingSenderId: "147786367145",
appId: "1:147786367145:web:9d4cba68071c3f29a8a9b8",
measurementId: "G-G8Z9DRHTZS",
},
},
};
function getEnvVars() {
if (process.env.NODE_ENV === "development") return ENV.test;
let releaseChannel = Updates.releaseChannel;
if (
releaseChannel === null ||
releaseChannel === undefined ||
releaseChannel === ""
)
return ENV.test;
if (releaseChannel.indexOf("development") !== -1) return ENV.test;
if (releaseChannel.indexOf("test") !== -1) return ENV.test;
if (releaseChannel.indexOf("default") !== -1) return ENV.prod;
else return ENV.prod;
}
export default getEnvVars();