Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


How to use dotenv file in CEP scripting

Participant ,
Nov 05, 2021 Nov 05, 2021

Copy link to clipboard

Copied

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?

TOPICS
Scripting

Views

21

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation