Node.js
This guide will show you how to integrate the Doppler CLI into your Node.js application development and debugging workflow inside Visual Studio Code.
Prerequisites
- Doppler CLI installed locally and authenticated
- Created a Doppler Project for your application
Setup
Ensure you've authenticated the Doppler CLI so secrets can be accessed from your machine:
doppler loginThen configure the Doppler CLI to select which project and environment to fetch secrets from by running the following command from a terminal within Visual Studio Code:
doppler setupLaunch Configuration
Update your existing launch configuration by creating or setting runtimeExecutable to doppler and runtimeArgs to include the command for running your application.
A typical launch configuration object will look like the following:
{
"version": "0.2.0",
"configurations": [
{
"name": "node: server",
"type": "node",
"request": "launch",
"runtimeExecutable": "doppler",
"runtimeArgs": ["run", "--", "npm","start"]
}
]
}
Awesome Work!Now you know how to inject Doppler secrets into your Node.js applications when developing with Visual Studio Code.
Updated about 1 year ago
