API Action failing with Node.js ERR_HTTP_INVALID_HEADER_VALUE

Hi everyone,

I'm trying to set up a simple proxy using API Action in a Node.js project.
My frontend sends a GET request to a Server Connect endpoint, and it needs to forward that request to my Python backend.

My frontend is successfully sending the following custom header:
X-Project-Key: pk_test_12345...

In my Server Connect API Action step, I am mapping the header like this:
Name: X-Project-Key
Value: {{$_SERVER.HTTP_X_PROJECT_KEY}} (I also tried $_HEADERS.x_project_key)

However, the API Action instantly crashes before the request even leaves Wappler. The Node.js server throws this 500 error:
```
{ "status": "500", "code": "ERR_HTTP_INVALID_HEADER_VALUE", "message": "Invalid value \"undefined\" for header \"X-Project-Key\"", "stack": "TypeError [ERR_HTTP_INVALID_HEADER_VALUE]: Invalid value \"undefined\" for header \"X-Project-Key\"..." }
```
What I have tried so far to fix it:

  1. Using .default("") e.g., {{$_SERVER.HTTP_X_PROJECT_KEY.default("")}}. This prevents the 500 crash, but it sends an empty string to my Python backend, which rejects it because the key is missing.

  2. Using $_HEADERS.x_project_key instead of $_SERVER. Same result.

  3. Creating intermediate "Set Value" steps before the API Action. Same result.

Is there a specific way we must format or access custom incoming headers that contain dashes (X-Project-Key) in Node.js projects so that the API Action evaluates them correctly instead of returning undefined?

Any guidance would be much appreciated!

I think the value $_Server.http_x_global_key is a PHP superglobal, not sure it is available on node platform?

I am calling the Server Connect endpoint using a standard fetch request like this:
``
fetch('/api/proxy/chat/history?conversation_id=...', { method: 'GET', headers: {'X-Project-Key': 'pk_test_123456789...' } });
``

When I inspect the browser's Headers tab, I can confirm the header is successfully leaving the browser and reaching the server.

My understanding was that in Wappler's Node.js environment, all incoming HTTP headers are automatically parsed and made available via the $_HEADERS (e.g., {{$_HEADERS.x_project_key}}) or$_SERVER (e.g., {{$_SERVER.HTTP_X_PROJECT_KEY}}).

The core issue is that API Action seems unable to extract this custom header from the incoming request, evaluating it as undefined even though the browser is definitely sending it.

Do I need to manually "define" incoming custom headers somewhere in the Server Connect Globals so the expression engine can see it?

My suggestion would be store the key value in an environment variable, say PROJECT_KEY via the api settings screen and address it's value as $_ENV.PROJECT_KEY

Thanks Brian for your suggestion.
I will give it a try & see if it is working.