How to use Doppler with Webstorm IDE

Hi everyone!

I’m starting to use Doppler and I would like to know how to integrate it with Webstorm IDE, both for common run configurations, but also for debugging.

I read the docs, but it seems there is nothing there about it.

Anyone can help me with this?

Hi @delucca and welcome to the Doppler community!

I’ve added a new WebStorm User Guide to our documentation.

Let me know if those steps work for you.

Hi! Thanks for helping me

I’m using NodeJS indeed. I’ve checked the doc you created. It is possible to achieve the same thing without changing the package.json file?

Right now, in the project, I am the only one using Doppler, so I can’t change the package.json entirely.

In the future that might change, but for me the best way would be configuring Doppler as launch configuration

Hi, can you please help me on this? :slight_smile:

Like I’ve explained, I’m using NodeJS indeed. I’ve checked the doc you created. It is possible to achieve the same thing without changing the package.json file?

Right now, in the project, I am the only one using Doppler, so I can’t change the package.json entirely.

In the future that might change, but for me the best way would be configuring Doppler as launch configuration

Hi @delucca,

What you can do as a workaround (although definitely not ideal) is to create a package.json file in a different location (e.g. in the parent directory), then configure the debug configuration to use that package.json.

This alternate package.json will contain the doppler-run script which will cd into your application directory, then run the script to start your application (e.g. npm start).

// package.json
{
    "scripts": {
        "doppler-run": "cd your-app-directory && doppler run --forward-signals -- npm start"
    }
}

Note the package.json field value is outside the application directory.

Oh, I see.

So, the only way right now is inside package.json? Are you guys working on an alternative to handle this?

Using Webstorm’s built in npm support is the best solution as Webstorm is then managing the Node.js process so debugging “just works”.

We could, for example use the Shell Script option and have the Doppler CLI spawn a Node process using the --inspect or --inspect-brk flags so it can automatically attach to the process, but that’s extra work for no great benefit.

Once a team adopts Doppler, they want it in their package.json because then once they’ve installed the Doppler CLI, they’re good to go.

Does that adequately answer your question?