Skip to main content
The Nango Proxy lets you make authenticated requests to any external API without managing tokens, API keys, or OAuth refresh logic in your application. You send the request to Nango with a connection ID, and Nango injects the right credentials, forwards the request, and returns the response.

When to use the proxy

Use the proxy when:
  • You need a quick, one-off API call without deploying a function
  • Your integration logic lives in your application code rather than Nango
  • You want centralized logging and retries for ad-hoc API calls
Use functions when:
  • You need to run complex multi-step logic
  • You want to cache or transform data before it reaches your app
  • You need incremental data fetching with checkpoints

How it works

Instead of calling an external API directly, you call Nango’s proxy endpoint with the same HTTP method, path, and body. Nango:
  1. Looks up the connection by providerConfigKey and connectionId
  2. Retrieves and refreshes credentials as needed
  3. Injects the credentials into the request (as a Bearer token, API key header, etc.)
  4. Forwards the request to the external API
  5. Returns the response to your application
All proxy calls are logged in the Nango dashboard.

Making proxy requests

import { Nango } from '@nangohq/node';

const nango = new Nango({ secretKey: process.env.NANGO_SECRET_KEY });

// GET request
const response = await nango.get({
    endpoint: '/users/me',
    providerConfigKey: 'github',
    connectionId: 'user-123'
});

console.log(response.data);

HTTP method shortcuts

The Node SDK provides convenience methods for all standard HTTP methods:
// GET
const res = await nango.get({ endpoint: '/issues', providerConfigKey: 'github', connectionId: 'user-123' });

// POST
const res = await nango.post({
    endpoint: '/repos/acme/my-repo/issues',
    providerConfigKey: 'github',
    connectionId: 'user-123',
    data: { title: 'Bug report', body: 'Something is broken' }
});

// PUT
const res = await nango.put({
    endpoint: '/issues/42',
    providerConfigKey: 'github',
    connectionId: 'user-123',
    data: { state: 'closed' }
});

// PATCH
const res = await nango.patch({
    endpoint: '/issues/42',
    providerConfigKey: 'github',
    connectionId: 'user-123',
    data: { title: 'Updated title' }
});

// DELETE
const res = await nango.delete({
    endpoint: '/issues/42/labels/bug',
    providerConfigKey: 'github',
    connectionId: 'user-123'
});
All methods also accept a method field via the generic nango.proxy() call.

ProxyConfiguration parameters

ParameterTypeRequiredDescription
endpointstringYesThe API path to call (e.g., /users/me). Appended to the provider’s base URL.
providerConfigKeystringYesThe integration ID in Nango (e.g., github, salesforce).
connectionIdstringYesThe ID of the connection whose credentials to use.
methodstringNoHTTP method: GET, POST, PUT, PATCH, DELETE. Defaults to GET.
headersRecord<string, string>NoAdditional headers to include in the request.
paramsRecord<string, string>NoQuery string parameters.
dataanyNoRequest body for POST, PUT, and PATCH requests.
retriesnumberNoNumber of retries with exponential backoff on failure (default: 0).
retryOnnumber[]NoAdditional HTTP status codes to retry on (e.g., [500, 503]).
baseUrlOverridestringNoOverride the provider’s default base URL.
responseTypestringNoAxios response type (e.g., 'arraybuffer' for binary responses).

Response format

The proxy returns a standard Axios response object:
const response = await nango.get({
    endpoint: '/repos/acme/my-repo',
    providerConfigKey: 'github',
    connectionId: 'user-123'
});

console.log(response.data);    // parsed response body
console.log(response.status);  // HTTP status code
console.log(response.headers); // response headers
Non-2xx responses throw an Axios error. Handle them with try/catch:
try {
    const res = await nango.post({
        endpoint: '/repos/acme/my-repo/issues',
        providerConfigKey: 'github',
        connectionId: 'user-123',
        retries: 3,
        data: { title: 'Bug report', body: 'Details here' }
    });

    console.log(res.data);
} catch (error) {
    console.error(error.response.status);
    console.error(error.response.data);
}

Retries

Pass retries: N to retry failed requests with exponential backoff. Rate-limit responses (429) are automatically retried regardless of this setting.
const res = await nango.post({
    endpoint: '/messages',
    providerConfigKey: 'slack',
    connectionId: 'user-123',
    retries: 5,
    data: { channel: '#general', text: 'Hello!' }
});

Proxy inside functions

The nango object available inside syncs and actions exposes the same proxy methods. You don’t need to provide providerConfigKey or connectionId — they are inferred from the function’s execution context:
exec: async (nango) => {
    // providerConfigKey and connectionId are set automatically
    const response = await nango.get({
        endpoint: '/user'
    });

    return response.data;
}

Proxy via REST API

You can also call the proxy directly via HTTP from any language:
curl -X POST \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <NANGO-SECRET-KEY>' \
  -H 'Provider-Config-Key: github' \
  -H 'Connection-Id: user-123' \
  -d '{"title": "Bug report", "body": "Something is broken"}' \
  'https://api.nango.dev/proxy/repos/acme/my-repo/issues'
The path after /proxy/ is forwarded to the external API’s base URL.

Build docs developers (and LLMs) love