Node.js

Secure secrets injection for Node.js applications in Visual Studio Code.

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

Setup

Ensure you've authenticated the Doppler CLI so secrets can be accessed from your machine:

doppler login

Then 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 setup

Launch 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.