# Injecting secrets while debugging Dart code on VSCode

**URL:** <https://community.doppler.com/t/injecting-secrets-while-debugging-dart-code-on-vscode/412>\
**Category:** Need Help\
**Created:** [November 16, 2021, 10:31pm UTC](https://community.doppler.com/t/injecting-secrets-while-debugging-dart-code-on-vscode/412 "2021-11-16T22:31:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![coastalcompile](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@coastalcompile](https://community.doppler.com/u/coastalcompile)\
**Post date:** [November 16, 2021, 10:31pm UTC](https://community.doppler.com/t/injecting-secrets-while-debugging-dart-code-on-vscode/412/1 "2021-11-16T22:31:28Z")

</div>

I am trying to use doppler to manage secrets for my dart application. I use VSCode and the DartCode extension to debug my code. I cannot figure out how to get doppler to automatically inject the secrets before my dart code runs.

I can manually run the code via `doppler run -- dart /my/dart/file.dart` but this doesn’t automatically attach the vscode debugger. How can I setup my launch config such that this is done automatically? DartCode does not support the"runtimeExecutable": “doppler” option from the nodejs debugger as mentioned in the Doppler docs.

I have also filed an issue here: [Feature: Specify shell or executable to use when debugging · Issue #3674 · Dart-Code/Dart-Code · GitHub](https://github.com/Dart-Code/Dart-Code/issues/3674)

---

<div class="post-metadata">

**Author:** ![ryan-blunden](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/ryan-blunden/32/9_2.png) [@ryan-blunden](https://community.doppler.com/u/ryan-blunden)\
**Post date:** [December 7, 2021, 5:00am UTC](https://community.doppler.com/t/injecting-secrets-while-debugging-dart-code-on-vscode/412/2 "2021-12-07T05:00:58Z")

</div>

Hey Andrew (@coastalcompile)!

I noticed [v3.29.0](https://dartcode.org/releases/v3-29/#debugger) of the Dart extension that was released on December 1st which added debugger support for a `customTool`.

Does the [launch.json example](https://github.com/Dart-Code/Dart-Code/issues/3656#issuecomment-978211278) in the comments for that issue provide the solution you need?

If so, I’d love to have you share the working launch configuration here so we can add it to our documentation.

---

<div class="post-metadata">

**Author:** ![coastalcompile](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@coastalcompile](https://community.doppler.com/u/coastalcompile)\
**Post date:** [December 30, 2021, 1:08am UTC](https://community.doppler.com/t/injecting-secrets-while-debugging-dart-code-on-vscode/412/3 "2021-12-30T01:08:56Z")

</div>

Ryan,

I would love to make use of that new feature since it is intended to solve this very issue. I have done some tests and attempted to get it to work but could not. As such, I opened a new issue here: [VSCode Dart Extension // customTool arg does not appear to work as intended · Issue #3749 · Dart-Code/Dart-Code · GitHub](https://github.com/Dart-Code/Dart-Code/issues/3749)

Once that gets resolved, I’ll create an example config and will post it back here.

---

<div class="post-metadata">

**Author:** ![ryan-blunden](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/ryan-blunden/32/9_2.png) [@ryan-blunden](https://community.doppler.com/u/ryan-blunden)\
**Post date:** [January 3, 2022, 3:22am UTC](https://community.doppler.com/t/injecting-secrets-while-debugging-dart-code-on-vscode/412/4 "2022-01-03T03:22:28Z")

</div>

That would be brilliant Andrew! Thanks!

---

<div class="post-metadata">

**Author:** ![coastalcompile](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@coastalcompile](https://community.doppler.com/u/coastalcompile)\
**Post date:** [January 3, 2022, 9:57pm UTC](https://community.doppler.com/t/injecting-secrets-while-debugging-dart-code-on-vscode/412/5 "2022-01-03T21:57:02Z")

</div>

Here is a working config for dart projects (does not work for flutter):

```auto
        {
            "name": "Debug with Doppler Env",
            "request": "launch",
            "type": "dart",
            "program": "bin/main.dart",
            "customTool": "doppler",
            "toolArgs": [
                "run",
                "--",
                "dart"
            ]
        },

```
