Skip to main content
Inspiring
November 5, 2021
Question

How to use dotenv file in CEP scripting

  • November 5, 2021
  • 1 reply
  • 300 views

According to this documentation:

To use a dotenv variable: 

process.env.ENV_VARIABLE // ENV_VARIABLE is the name of the variable you want to access.

Pretty straight forward node stuff.... So in my root folder I create a dotenv file ".env"

there I put:

TEST_VARIABLE=HITHERE

Then in a js file I run:

console.log(cep_node.process.env.TEST_VARIABLE);

This is appearing as undefiend.  What do I need to do to use my dotenv file?

This topic has been closed for replies.

1 reply

Participant
November 15, 2024

Did you ever solve this?