# App functions - how to debug with VS code

**URL:** <https://community.dynatrace.com/t/app-functions-how-to-debug-with-vs-code/52352>\
**Category:** Developer Q&A Forum\
**Created:** [July 4, 2025, 10:13am UTC](https://community.dynatrace.com/t/app-functions-how-to-debug-with-vs-code/52352 "2025-07-04T10:13:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zoltan](https://avatars.discourse-cdn.com/v4/letter/z/ad7895/32.png) [@Zoltan](https://community.dynatrace.com/u/Zoltan)\
**Post date:** [July 4, 2025, 10:13am UTC](https://community.dynatrace.com/t/app-functions-how-to-debug-with-vs-code/52352/1 "2025-07-04T10:13:34Z")

</div>

Hi,

I am curious if it’s possible to debug app functions with breakpoint pauses.

So far, when I try to fix something that’s not working, either I deploy a test version of my app function to dyna could, then call it, and try to make sense of the logs, or run it locally with jest. But in the latter case, I can’t call dynatrace callbacks, as when executed with yest, the client library is not initialized.

Ok, I can mock, but the whole point would be to debug with live data.

Any suggestions?  
Thanks,  
Zoltan

this is an example I want to call and step by step debug:

 ![Zoltan_0-1751623979337.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/b/8b9d8fff324786e1ee4ce29d112362416230774f.png)

---

<div class="post-metadata">

**Author:** ![dani\_coll](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dani_coll/32/33669_2.png) [@dani\_coll](https://community.dynatrace.com/u/dani_coll)\
**Post date:** [July 4, 2025, 11:07am UTC](https://community.dynatrace.com/t/app-functions-how-to-debug-with-vs-code/52352/2 "2025-07-04T11:07:34Z")

</div>

Hi Zoltan,

If you created the project through the **dt-app CLI** you should have a _.vscode/launch.json_ file that includes debugging settings. By running that configuration you can debug your app function using breakpoints

 ![dani_coll_0-1751627078574.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/8/386f90697dbd2e3ae6eefa29d0319774b18a25ce.png)

---

<div class="post-metadata">

**Author:** ![Zoltan](https://avatars.discourse-cdn.com/v4/letter/z/ad7895/32.png) [@Zoltan](https://community.dynatrace.com/u/Zoltan)\
**Post date:** [September 11, 2025, 8:56am UTC](https://community.dynatrace.com/t/app-functions-how-to-debug-with-vs-code/52352/3 "2025-09-11T08:56:12Z")

</div>

Hi Dani,

Indeed, it works as you described (on a note - I had my project generated way back, where the launch.json generated didn’t have this run config.  
Also, what was confusing a bit was that the breakpoint is only shown as active during a request. When you set it, it appears as to be inactive - don’t know why, perhaps it’s my vs code setup…

While we are here one more question:  
How do I pass the payload param to the function via a plain http request? Can’t find an example in the docs.  
Is the json post body what becomes the payload param of the function?  
export default async function (payload: unknown = undefined)

Thanks,

Zoltan

---

<div class="post-metadata">

**Author:** ![dani\_coll](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dani_coll/32/33669_2.png) [@dani\_coll](https://community.dynatrace.com/u/dani_coll)\
**Post date:** [September 15, 2025, 10:00am UTC](https://community.dynatrace.com/t/app-functions-how-to-debug-with-vs-code/52352/4 "2025-09-15T10:00:12Z")

</div>

Yes, it should be the body. Using the **fetch** command it’s something like this

```markup
const method = options?.data ? 'POST' : 'GET';
const body = options?.data ? JSON.stringify(options.data) : undefined;

const response = await fetch(`/api/${functionName}`, { body, method });

```
