OAuth2 Help

Hello!

I’m trying to build a very simple app to understand exactly how the OAuth2 flow with homey works since I’m not experienced with it.

I keep running into the following issue when I try to run the app with homey app run:
Warning: Trying to access Homey.env.CLIENT_ID but the environment variable has not been set!
Warning: Trying to access Homey.env.CLIENT_SECRET but the environment variable has not been set!

I defined them in my app.json, is this not the correct way?
Do I need to upload the app towards the cloud and set them there? And can that be reused for further debugging?

I’m breaking my brain over it, it didn’t think it would be this confusing but the documentation is also lacking the part of where to store the client secret/ID.

For more context I want to auto generate the token for google calendar API access, but couldnt get that to work so now I’m building a demo app that tries to fetch my github profile.

Any help would be greatly appreciated.

if I remember correctly you need to use an .env file in the root of the project

Start reading here

Use the Athom npm module to add a base layer for oAuth2 to your app.
Set env variables in env.json file and set this as excluded for Github upload.

If you follow the link, you get an example and the SDK for this module.