lelylan/simple-oauth2

Enable debug in firebase?

arthabus opened this issue · 1 comments

Context

  • node version: v14.18.1
  • module version: 5.0.0
  • environment (e.g. node, browser, native): node
  • any other relevant information: firebase functions node to be more specific

How can we help?

Hi guys, do you know how to enable debug in firebase functions node environment?

The doc says to add DEBUG=simple-oauth2 as an environment variable but I don't believe firebase functions has a way to set environment variables apart from what is available in functions.config()

Ended up setting process.env manually in code which enabled the debug:

process.env.DEBUG = "*simple-oauth2*"

Just put it anywhere before importing simple-oauth2

Another approach is described here:
debug-js/debug#479 (comment)

Which is to add .env file to functions and read it using dotenv package like this:

require('dotenv').config();

I don't think the rest from the linked thread is necessary to enable debug.