# How do I use the Management Client via a proxy server in "node-auth0 4.27.0"?

**URL:** <https://community.auth0.com/t/how-do-i-use-the-management-client-via-a-proxy-server-in-node-auth0-4-27-0/189882>\
**Category:** Get Help\
**Tags:** tickets, management-api\
**Created:** [July 30, 2025, 5:02am UTC](https://community.auth0.com/t/how-do-i-use-the-management-client-via-a-proxy-server-in-node-auth0-4-27-0/189882 "2025-07-30T05:02:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xkinjyou](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/xkinjyou/32/65010_2.png) [@xkinjyou](https://community.auth0.com/u/xkinjyou)\
**Post date:** [July 30, 2025, 5:02am UTC](https://community.auth0.com/t/how-do-i-use-the-management-client-via-a-proxy-server-in-node-auth0-4-27-0/189882/1 "2025-07-30T05:02:17Z")

</div>

What should I do if I want to connect to Auth0’s “Management Client” via a proxy server I have set up myself?

> **[auth0](https://auth0.github.io/node-auth0/)**
>
> Documentation for auth0

---

<div class="post-metadata">

**Author:** ![teodor.andrei](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/teodor.andrei/32/75320_2.png) [@teodor.andrei](https://community.auth0.com/u/teodor.andrei)\
**Post date:** [July 30, 2025, 3:51pm UTC](https://community.auth0.com/t/how-do-i-use-the-management-client-via-a-proxy-server-in-node-auth0-4-27-0/189882/3 "2025-07-30T15:51:39Z")

</div>

Hi @xkinjyou, and welcome back to the Auth0 Community!

I will look into it and come back to you with what I found.

Thanks!  
Teodor.

---

<div class="post-metadata">

**Author:** ![teodor.andrei](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/teodor.andrei/32/75320_2.png) [@teodor.andrei](https://community.auth0.com/u/teodor.andrei)\
**Post date:** [July 31, 2025, 1:37pm UTC](https://community.auth0.com/t/how-do-i-use-the-management-client-via-a-proxy-server-in-node-auth0-4-27-0/189882/4 "2025-07-31T13:37:07Z")

</div>

Hi again @xkinjyou!

You’ll need to configure the Auth0 Node.js SDK to use a custom HTTP agent that routes requests through your proxy. The easiest way to do this is with the `https-proxy-agent` library.

You’ll have to create an instance of the `HttpsProxyAgent` with your proxy server’s URL and pass it into the `ManagementClient` configuration.

Please try something like this:

```auto
import { ManagementClient } from 'auth0';
import { HttpsProxyAgent } from 'https-proxy-agent';

const proxyUrl = 'http://your-proxy-server.com:8080';

const proxyAgent = new HttpsProxyAgent(proxyUrl);

const management = new ManagementClient({
  domain: 'YOUR_AUTH0_DOMAIN',
  clientId: 'YOUR_CLIENT_ID',
  clientSecret: 'YOUR_CLIENT_SECRET',
  proxy: proxyAgent,
});

async function testConnection() {
  try {
    const users = await management.users.getAll({ per_page: 1 });
    console.log('Successfully fetched users via proxy.');
  } catch (error) {
    console.error('Error fetching users:', error);
  }
}

testConnection();

```

If your proxy server requires a username and password, include them in the URL like this: `http://user:password@your-proxy-server.com:8080`

I hope this helps!

Sincerely,  
Teodor.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [August 14, 2025, 1:37pm UTC](https://community.auth0.com/t/how-do-i-use-the-management-client-via-a-proxy-server-in-node-auth0-4-27-0/189882/5 "2025-08-14T13:37:33Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
