Skip to content

Question: How can I use environment variables? #89

Description

@josebruno2020

What are you trying to accomplish? Please describe.
Helo, I'm building a carrier service, and I would like to know how to use environment variables in a NodeJs vtex-app.

What have you tried so far?
I tried to use dotenv, but with no success. I also tried to follow this tutorial, but also don't work.

Additional info
when I tried to do this:

    const token = process.env.TOKEN

    console.info(process.env)

    console.info(`TOKEN: ${token}`)

I received this message in my console:
Image

Account Workspace
stoneentregaspartnerbr local

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions