Kubessandra / react-google-calendar-api

An api to manage your google calendar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use environment variables in apiGoogleconfig.json

haseebanwar opened this issue · comments

Is there any way to make a JS file for apiGoogleconfig.json so environment variables can be loaded (if clientId / apiKey is stored in an env variable).

You can generate it like this, but with the actual version this is not possible you can make a PR and Rename the import to apiGoogleconfig.json by apiGoogleconfig and submit it and both json and js files will work.

Here is a script to generate apiGoogleconfig.json with env variables.

#!/bin/sh

echo '{"clientId": "$CLIENT_ID","apiKey": "$API_KEY","scope": "https://www.googleapis.com/auth/calendar","discoveryDocs": ["https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest"]}' > ./apiGoogleconfig.json