Nango Auth lets your users connect 1,000+ external APIs to your product. You embed a Nango-managed auth flow in your application, and Nango handles authorization, credential storage, refresh, and validation.A Connection is created after each successful authorization. It stores one user’s credentials for one external API and keeps them valid over time. Credentials can be retrieved at scale or used directly by other Nango primitives — without ever passing through your codebase.
Auth schemes — OAuth 2.0, OAuth 1.0a, API keys, basic auth, custom. 1,000+ APIs supported; new ones added on demand within days, by request or self-contributed.
Credential management — Encrypted storage, automatic refresh, retrieval at scale. Combine with Proxy or Functions to avoid handling credentials directly.
Observability — Failure detection, reconnect flow, and per-connection logs.
Using a coding agent? Set up the docs MCP and skills, then copy this page as prompt.
1
Create a Nango account
Sign up for free (no credit card):
For agents
Signup cannot be automated. Ask the user to sign up at app.nango.dev/signup and provide their Nango API key from the Environment settings tab > API Keys. Use it as Authorization: Bearer <NANGO-API-KEY> in API requests.The default API key created on signup has full access and is the simplest option.If the user creates a scoped API key instead, this guide needs environment:integrations:create (step 2) and environment:connect_sessions:write (steps 5 and 8). See API keys.
2
Create an integration
In the dashboard, open the Integrations tab, click Configure New Integration, and pick the API.
OAuth APIs require an OAuth developer app registered with the provider. Register one on the provider’s developer portal, use the Callback URL shown in your Nango integration settings, then paste the Client ID and Client Secret back into Nango. Register any required scopes too.If this integration will be used in production, complete the optional custom callback URL step below before real users connect. Retrofitting a callback URL later requires updating the provider app and can break new authorization or reconnect flows until the provider and Nango settings match.For OAuth 2.0 providers, Nango shows suggested scopes — auto-discovered and refreshed at least monthly. They’re suggestions; you can use any scope the provider supports.
For popular APIs, Nango provides pre-approved OAuth apps. They work in production, but we recommend registering your own OAuth app before you go live — see Nango-managed OAuth apps below.
For agents
Create the integration with the API. If you need the provider slug first, list providers and use the matching provider’s name field:
For OAuth providers, walk the user through registering an OAuth developer app on the provider’s portal: link them to the provider’s OAuth-app creation page, tell them which Callback URL to paste (visible in the Nango integration settings after creation), and ask them to send back the client_id and client_secret so you can pass them in the request body.
In the Connections tab, click Add Test Connection, pick your integration, and authorize using a test account. The new connection’s credentials appear in its Authorization tab — securely stored and automatically refreshed.
For agents
Skip the dashboard. Create a connect session and share the returned connect_link with the user — they authorize using their test account in the browser, no UI needed on your side:
The response contains a connect_link (valid 30 minutes). Send it to the user; once they complete authorization, confirm with GET /connections. See Share a connect link.
4
Configure a custom OAuth callback URL (optional, recommended)
For production OAuth apps, a callback URL on your own domain is recommended. Some providers show the callback domain to users.To configure a custom callback URL:
Add an endpoint on your domain (e.g. https://example.com/oauth-callback) that 308-redirects to https://api.nango.dev/oauth/callback, preserving all query parameters.
Update the registered callback URL with each API provider — otherwise they’ll reject new authorization flows.
After confirming steps 1 and 2, update the callback URL in Nango’s Environment Settings. Settings are per-environment, so repeat for every environment.
For agents
Ask the user what production callback URL they want to use, then have them add a 308 redirect from that URL to https://api.nango.dev/oauth/callback before they register provider OAuth apps. You can set callback_url when creating an environment from the public endpoint. Ask the user for an Account API key and send it as Authorization: Bearer <NANGO-API-KEY>. Updating an existing environment’s callback URL is dashboard-only — ask the user to paste the final callback URL into Environment Settings > Backend.
5
Generate a session token (backend)
Set up a backend endpoint that your frontend will call before each authorization attempt to retrieve a session token from Nango (API / Node SDK).You’ll need an API key with the environment:connect_sessions:write scope (find it in Environment Settings > API Keys).
Tags reconcile Nango’s auth-success webhook with the right user, org, or entity in your system. Most apps start with: end_user_id, end_user_email, organization_id.Tags are also useful for filtering connections via the API and are displayed in the Nango UI. Set the reserved UI tag keys end_user_display_name and end_user_email to populate the connections list and connection detail page.See Connection tags, configuration, and metadata for more.
allowed_integrations controls what the user sees:
Multiple integrations — Connect UI shows a picker.
Single integration — Connect UI sends the user straight to its auth flow.
6
Trigger the auth flow (frontend)
Load the Nango frontend SDK, fetch the session token from your backend, and open Connect UI:
Connect UI authorization flow
import Nango from '@nangohq/frontend';const nango = new Nango();const connect = nango.openConnectUI({ onEvent: (event) => { if (event.type === 'close') { // Modal closed. } else if (event.type === 'connect') { // Auth flow successful. } },});const res = await fetch('/sessionToken', { method: 'POST' });connect.setSessionToken(res.sessionToken); // A loading indicator shows until this is set.
Listen for webhooks & save the connection ID (backend)
When authorization succeeds, Nango generates a unique connection ID. You use this ID to manage the connection and retrieve its credentials. You must store it on your side, attached to the user/org/project that owns the connection — Nango doesn’t model that ownership.Set up the webhook in Environment Settings:
Specify a Webhook URL in the Nango UI.
Enable Send New Connection Creation Webhooks.
Handle POST requests on that route in your backend.
For agents
Webhook URL configuration is dashboard-only — there is no public API to set environment webhook URLs. Ask the user to paste the webhook URL into Environment Settings and enable Send New Connection Creation Webhooks.
Persist connectionId against whichever entity owns the connection in your app.
8
Build re-authorization
Credentials can become invalid when users revoke access, providers rotate refresh tokens, scopes change, or an app moves from testing to production. Re-authorization updates an existing connection’s credentials while preserving its data and config. Deleting and re-creating the connection wipes that data — prefer re-authorization.Before showing integration settings, check the connection with GET /connections/{connectionId}:
Node
cURL
import { Nango } from '@nangohq/node';const nango = new Nango({ apiKey: process.env.NANGO_API_KEY! });try { await nango.getConnection('<INTEGRATION-ID>', '<CONNECTION-ID>'); // Connection is valid.} catch (error) { if (error.response?.data?.error?.code === 'invalid_credentials') { // Connection is invalid — show a Reconnect button. displayReconnectUI(); }}
An invalid_credentials error means the connection failed credential refresh or validation — show an error state with a Reconnect button.To trigger re-authorization, use the same frontend flow as a new connection, but generate a reconnect session token on the backend. Pass the returned token to the Frontend SDK exactly like a normal session token. On success you’ll receive an auth webhook with operation = override.The connection keeps its connection ID. It also keeps its tags, unless the reconnect session passes non-empty tags or an end_user, which replace them.
Nango provides pre-approved OAuth apps for popular APIs such as Gmail, Outlook, Salesforce, and HubSpot. Use them to test connections without registering an app with the provider.Nango-managed apps work in production, but we recommend registering your own OAuth app before you go live:
Whitelabel auth — with a Nango-managed app, the consent screen shows Nango, not your product.
Scopes — Nango-managed apps have fixed scopes. Your own app can request any scope the provider offers.
Callback URL — Nango-managed apps use Nango’s callback URL. Your own app can use a custom callback URL on your domain.
Marketplace listings — provider marketplaces require your own app.
API features — some provider features are only available to first-party apps.
Revocation risk — most providers don’t allow shared credentials. If a provider revokes a Nango-managed app, every connection using it stops working.
Portability — only with your own app can you export access and refresh tokens and move off Nango without users re-authorizing.
These tradeoffs apply to shared OAuth apps from any auth platform, not just Nango.To make registering your own app easier, Nango maintains step-by-step setup guides for most OAuth APIs in APIs & Integrations, for example Gmail.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Nango Docs","colors":{"primary":"#29abe2","light":"#71c0e2","dark":"#217ea6"},"logo":{"light":"https://mintcdn.com/nango/h2zzveDlAs05T6zr/images/Nango-Light-Mode.svg?fit=max\u0026auto=format\u0026n=h2zzveDlAs05T6zr\u0026q=85\u0026s=0c2845b2219705011e11ef4985aa9d91","dark":"https://mintcdn.com/nango/h2zzveDlAs05T6zr/images/Nango-Dark-Mode.svg?fit=max\u0026auto=format\u0026n=h2zzveDlAs05T6zr\u0026q=85\u0026s=850ee557541d6e0b523aa22a086f45c5","href":"https://nango.dev"},"favicon":{"light":"https://mintcdn.com/nango/J3bBfZ1D3NjDI-Wu/favicon-black.svg?fit=max\u0026auto=format\u0026n=J3bBfZ1D3NjDI-Wu\u0026q=85\u0026s=6759e69f959345295eaa1a3b61eff463","dark":"https://mintcdn.com/nango/J3bBfZ1D3NjDI-Wu/favicon-white.svg?fit=max\u0026auto=format\u0026n=J3bBfZ1D3NjDI-Wu\u0026q=85\u0026s=f9b0cb2c74ef91143ca48dea01bb16e0"},"api":{"mdx":{"auth":{"method":"bearer"},"server":["https://api.nango.dev","http://localhost:3003"]}},"appearance":{"default":"system"},"background":{"decoration":"grid","color":{"light":"#ffffff","dark":"#0b0b0c"}},"navbar":{"links":[{"href":"https://github.com/NangoHQ/nango","label":"GitHub","type":"github"},{"href":"https://app.nango.dev","label":"Log In"}],"primary":{"type":"button","label":"Sign Up","href":"https://app.nango.dev/signup"}},"footer":{"socials":{"twitter":"https://twitter.com/NangoHQ","linkedin":"https://www.linkedin.com/company/nangohq","github":"https://github.com/NangoHQ/nango","slack":"https://nango.dev/slack","website":"https://nango.dev/"}},"seo":{"metatags":{"og:type":"website","og:site_name":"Nango Docs"},"indexing":"all"},"fonts":{"family":"Albert Sans"},"integrations":{"gtm":{"tagId":"GTM-N4KVPWR"}},"contextual":{"options":["copy","mcp","cursor","vscode","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"nango","hasAudioNarration":false,"actualSubdomain":"nango","customDomains":["nango.dev"],"gitSource":{"type":"github","owner":"nangohq","repo":"nango","deployBranch":"master","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae2384e062c116bf4115d7c","collectionId":"2228dead-1fde-4e8c-b6e5-5091eee155cb","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae2384e062c116bf4115d7c"},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae2384e062c116bf4115d7c","clientVersion":"0.0.4005","searchFilterCounts":[{"language":"default","tag":"APIs \u0026 Integrations","count":1076},{"language":"default","tag":"1,000+ APIs \u0026 Integrations","count":1073},{"language":"default","tag":"Documentation","count":123},{"language":"default","tag":"Reference","count":69},{"language":"default","tag":"Backend","count":66},{"language":"default","tag":"HTTP API","count":58},{"language":"default","tag":"Guides","count":43},{"language":"default","tag":"Functions","count":30},{"language":"default","tag":"Platform","count":18},{"language":"default","tag":"Getting started","count":11}]},"assistantConfig":{"enableStarterQuestions":false},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"custom.css","content":".agent-quickstart-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0 24px}.agent-quickstart-actions--single{grid-template-columns:minmax(0,1fr);max-width:720px}.agent-quickstart-action{display:flex;flex-direction:column;gap:6px;width:100%;padding:16px;border:1px solid rgba(0,0,0,.12);background:rgba(255,255,255,.72);color:inherit;font:inherit;text-align:left;cursor:pointer;transition:border-color 140ms ease,background-color 140ms ease,transform 140ms ease}.agent-quickstart-action:focus-visible,.agent-quickstart-action:hover{border-color:rgba(41,171,226,.7);background:rgba(41,171,226,.06);transform:translateY(-1px)}.agent-quickstart-action--primary{border-color:rgba(41,171,226,.4);background:rgba(41,171,226,.08)}.agent-quickstart-action[aria-busy=true]{opacity:.7;cursor:wait}.agent-quickstart-action-title{font-size:15px;font-weight:600;line-height:1.4}.agent-quickstart-action-description{color:#515556;font-size:14px;line-height:1.5}.dark .agent-quickstart-action{border-color:rgba(255,255,255,.14);background:rgba(255,255,255,.04)}.dark .agent-quickstart-action:focus-visible,.dark .agent-quickstart-action:hover{border-color:rgba(41,171,226,.8);background:rgba(41,171,226,.12)}.dark .agent-quickstart-action-description{color:rgba(255,255,255,.68)}.agent-copy-toast{position:fixed;right:24px;bottom:24px;z-index:250;max-width:min(320px,calc(100vw - 48px));padding:10px 12px;border:1px solid rgba(0,0,0,.1);background:#111827;color:#fff;font-size:14px;line-height:1.4;opacity:0;pointer-events:none;transform:translateY(8px);transition:opacity 140ms ease,transform 140ms ease}.agent-copy-toast[data-visible=true]{opacity:1;transform:translateY(0)}.agent-copy-toast[data-kind=error]{background:#7f1d1d}@media (max-width:640px){.agent-quickstart-actions{grid-template-columns:1fr}.agent-copy-toast{right:16px;bottom:16px;max-width:calc(100vw - 32px)}}.rounded,.rounded-2xl,.rounded-3xl,.rounded-full,.rounded-lg,.rounded-md,.rounded-sm,.rounded-xl,[class~=rounded-2xl],[class~=rounded-3xl],[class~=rounded-lg],[class~=rounded-md],[class~=rounded-sm],[class~=rounded-xl],button,code,input,kbd,pre,select,textarea{border-radius:4px!important}[class*=background-decoration]{opacity:.02!important;z-index:0!important;pointer-events:none}#navbar a[href=\"https://github.com/NangoHQ/nango\"] span.truncate,#sidebar-content .pointer-events-none.sticky{display:none!important}@media (max-width:767px){a[href=\"https://github.com/NangoHQ/nango\"]{display:none!important}}[id^=headlessui-dialog-]:not([id*=panel]){z-index:200!important}[id^=headlessui-dialog-panel],[id^=headlessui-dialog-panel] [class*=bg-background],[id^=headlessui-dialog-panel] [class*=bg-white],[id^=headlessui-dialog-panel]>div,details,summary{border-radius:4px!important}details[open]>summary{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}@media (min-width:768px){#navbar{position:fixed!important;top:0!important;left:0!important;right:0!important;width:100%!important;z-index:30!important}}.dark #navbar{background-color:#0b0b0c!important;border-bottom:1px solid rgba(255,255,255,.08)!important}html:not(.dark) #navbar{background-color:#fff!important;border-bottom:1px solid rgba(0,0,0,.08)!important}#navbar [class*=border-b]{border-bottom:none!important}.dark #sidebar-content{background-color:#0b0b0c!important}.dark :has(>#sidebar-content){border-right:1px solid rgba(255,255,255,.08)!important}html:not(.dark) :has(>#sidebar-content){border-right:1px solid rgba(0,0,0,.08)!important}#navigation-items{padding-top:20px!important}#navigation-items img[src$=\"/images/mcp.svg\"]{opacity:.38}.dark #navigation-items img[src$=\"/images/mcp.svg\"]{filter:invert(1);opacity:.58}#table-of-contents{scrollbar-width:none}#table-of-contents::-webkit-scrollbar{width:0;background:0 0}#table-of-contents:hover{scrollbar-width:thin}#table-of-contents:hover::-webkit-scrollbar{width:6px}#table-of-contents:hover::-webkit-scrollbar-thumb{background-color:rgba(128,128,128,.4);border-radius:4px}#table-of-contents:hover::-webkit-scrollbar-thumb:hover{background-color:rgba(128,128,128,.6)}#table-of-contents a{padding:4px 8px!important;border-radius:4px!important;display:block!important}html:not(.dark) #table-of-contents a{color:#515556!important}html:not(.dark) #table-of-contents a:hover{color:#000!important}.dark #table-of-contents a{color:rgba(255,255,255,.6)!important}.dark #table-of-contents a:hover{color:#fff!important}#table-of-contents .toc-item[data-depth=\"1\"]>a{padding-left:24px!important}#table-of-contents .toc-item[data-depth=\"2\"]>a{padding-left:40px!important}.dark #table-of-contents:not(:has(.toc-item[data-active=true])) .toc-item[data-scroll-active=true]>a{background-color:rgba(255,255,255,.07);color:rgba(255,255,255,.9);font-weight:500}html:not(.dark) #table-of-contents:not(:has(.toc-item[data-active=true])) .toc-item[data-scroll-active=true]>a{background-color:rgba(0,0,0,.06);color:#000;font-weight:500}@media (min-width:1024px){body:has([data-page-href*=\"updates/changelog\"]) :has(>#sidebar-content){width:184px!important;border-right:0!important;pointer-events:none!important}body:has([data-page-href*=\"updates/changelog\"]) #sidebar-content{display:none!important}body:has([data-page-href*=\"updates/changelog\"]) .update-container{margin-left:-184px!important;width:calc(100% + 184px)!important;max-width:none!important}}[data-page-href*=\"updates/changelog\"] .update-container+hr{margin-top:1rem!important;margin-bottom:1rem!important}.nav-logo,img.nav-logo,svg.nav-logo{height:36px!important;width:auto!important;max-width:none!important}#content-area{position:relative;z-index:1}@media (min-width:768px){#content-area{padding-top:6rem!important}#content-area>div:first-child{margin-top:1.5rem!important}#content-side-layout{margin-top:6rem!important}}[data-component-part=scroll-area-viewport]:has(>[data-component-part=scroll-area-content]>div>select[aria-label='Select base URL']){overflow:visible!important;mask-image:none!important}[data-component-part=scroll-area-content]:has(>div>select[aria-label='Select base URL']){min-width:0!important;flex-wrap:wrap!important;column-gap:2px!important;row-gap:2px!important}[data-component-part=scroll-area-content]:has(>div>select[aria-label='Select base URL'])>div:last-child{display:contents!important}.dark #navigation-items>ul{padding-bottom:20px!important;border-bottom:1px solid rgba(255,255,255,.08)!important;margin-bottom:0!important}html:not(.dark) #navigation-items>ul{padding-bottom:20px!important;border-bottom:1px solid rgba(0,0,0,.08)!important;margin-bottom:0!important}.dark a.nav-anchor>div[style*=background]{background:rgba(255,255,255,.1)!important}html:not(.dark) a.nav-anchor>div[style*=background]{background:rgba(0,0,0,.06)!important}.dark #sidebar-group a,.dark #sidebar-group button,.dark a.nav-anchor{color:rgba(255,255,255,.55)!important}.dark a.nav-anchor[class*=text-primary]{color:rgba(255,255,255,.9)!important}.dark a.nav-anchor:hover{color:#fff!important}html:not(.dark) #sidebar-group a,html:not(.dark) #sidebar-group button,html:not(.dark) a.nav-anchor{color:rgba(0,0,0,.7)!important}html:not(.dark) a.nav-anchor[class*=text-primary]{color:rgba(0,0,0,.9)!important}html:not(.dark) a.nav-anchor:hover{color:#000!important}.dark li[data-active=true]>a{background-color:rgba(255,255,255,.07)!important;color:#fff!important;border-radius:4px!important}html:not(.dark) li[data-active=true]>a{background-color:rgba(0,0,0,.06)!important;color:#000!important;border-radius:4px!important}.dark #sidebar-group a:hover,.dark #sidebar-group button:hover{color:rgba(255,255,255,.85)!important;background-color:rgba(255,255,255,.04)!important;border-radius:4px!important}html:not(.dark) #sidebar-group a:hover,html:not(.dark) #sidebar-group button:hover{color:rgba(0,0,0,.85)!important;background-color:rgba(0,0,0,.04)!important;border-radius:4px!important}div:has(>img[src=\"/images/mcp.svg\"])>img{display:none}div:has(>img[src=\"/images/mcp.svg\"])::before{content:\"\";width:1rem;height:1rem;background-color:currentColor;-webkit-mask:url(/images/mcp.svg) center/contain no-repeat;mask:url(/images/mcp.svg) center/contain no-repeat}#sidebar-group a,#sidebar-group button{padding:3px 8px!important;border-radius:4px!important}#sidebar-group li li a,#sidebar-group li li button{padding-left:20px!important}#sidebar-group li li li a,#sidebar-group li li li button{padding-left:32px!important}.sidebar-group-header{padding-left:8px!important}@media (min-width:768px){#sidebar-title,.sidebar-group-header h5{font-size:.7rem!important;text-transform:uppercase!important;letter-spacing:.07em!important;font-weight:600!important}.dark #sidebar-title,.dark .sidebar-group-header h5{color:rgba(255,255,255,.9)!important}html:not(.dark) #sidebar-title,html:not(.dark) .sidebar-group-header h5{color:rgba(0,0,0,.75)!important}}@media (max-width:767px){#sidebar-title,.sidebar-group-header h5{font-size:.9375rem!important;text-transform:none!important;letter-spacing:0!important;font-weight:700!important}.dark #sidebar-title,.dark .sidebar-group-header h5{color:rgba(255,255,255,.95)!important}html:not(.dark) #sidebar-title,html:not(.dark) .sidebar-group-header h5{color:rgba(0,0,0,.9)!important}}#navbar a[href=\"https://app.nango.dev\"],#navbar a[href=\"https://app.nango.dev/signup\"]{padding:7px 16px!important;font-size:.875rem!important;font-weight:500!important;border-radius:4px!important;line-height:1.25rem!important}#navbar a[href=\"https://app.nango.dev\"]{margin-right:-8px!important}#navbar a[href=\"https://app.nango.dev/signup\"]{margin-left:-8px!important;background-color:#29abe3!important;background-image:none!important;border:1px solid #29abe3!important;color:#fff!important}.dark #navbar a[href=\"https://app.nango.dev\"]{display:inline-flex!important;align-items:center!important;background-color:transparent!important;color:#fff!important;border:1px solid rgba(255,255,255,.25)!important;text-decoration:none!important}.dark #navbar a[href=\"https://app.nango.dev\"]:hover{background-color:rgba(255,255,255,.08)!important}#navbar a[href=\"https://app.nango.dev/signup\"] span.absolute,#navbar a[href=\"https://app.nango.dev/signup\"] span[class*=bg-primary],#navbar a[href=\"https://app.nango.dev/signup\"]>span:first-child{display:none!important}#navbar a[href=\"https://app.nango.dev/signup\"]:hover{background-color:#217ea6!important;border-color:#217ea6!important;color:#fff!important}#content-area div.rounded-2xl.pointer-events-auto[class*=bg-background-light],.chat-assistant-floating-input{display:none!important}.sticky:has(>#chat-assistant-sheet){z-index:40!important}"}],"page":{"pagePath":"guides/auth/auth-guide","slug":"/guides/auth/auth-guide","pageMetadata":{"title":"Auth guide","sidebarTitle":"Auth guide","description":"Let your users connect external APIs to your agents \u0026 apps.","href":"/guides/auth/auth-guide"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Let your users connect external APIs to your agents \u0026 apps.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Accordion,CodeBlock,Frame,Heading,Note,OptimizedImage,Step,Steps,Tab,Tabs,Tip}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsx(_components.p,{children:`Nango Auth lets your users connect 1,000+ external APIs to your product. You embed a Nango-managed auth flow in your application, and Nango handles authorization, credential storage, refresh, and validation.`}),`\n`,_jsxs(_components.p,{children:[`A `,_jsx(_components.strong,{children:`Connection`}),` is created after each successful authorization. It stores one user’s credentials for one external API and keeps them valid over time. Credentials can be retrieved at scale or used directly by other Nango primitives — without ever passing through your codebase.`]}),`\n`,_jsx(Heading,{level:`2`,id:`how-it-works`,children:`How it works`}),`\n`,_jsx(_components.p,{children:`The end-to-end flow has four steps:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Backend`}),` — your server asks Nango for a short-lived `,_jsx(_components.strong,{children:`session token`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Frontend`}),` — your app opens the Nango `,_jsx(_components.strong,{children:`Connect UI`}),` with that token.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`User`}),` — authorizes the API. Nango stores the credentials.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Backend`}),` — Nango sends an `,_jsx(_components.strong,{children:`auth webhook`}),` with the `,_jsx(_components.strong,{children:`connection ID`}),`. You persist it alongside your user/org/project.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`Once you have the connection ID, fetch credentials whenever you need them:`}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`TypeScript`,id:`typescript`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` nango`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getConnection`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`integrationId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`connectionId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})})}),_jsx(Tab,{title:`cURL`,id:`curl`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.nango.dev/connections/{connectionId}?provider_config_key={integrationId}\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer {nangoApiKey}\"`})]}),`\n`]})})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`capabilities`,children:`Capabilities`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Auth schemes`}),` — OAuth 2.0, OAuth 1.0a, API keys, basic auth, custom. 1,000+ APIs supported; new ones `,_jsx(_components.a,{href:`/integrations/contribute-or-request-api`,children:`added on demand`}),` within days, by request or self-contributed.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Pre-built UI`}),` — Embedded Connect UI with API-specific guidance, input validation, and your branding. Or `,_jsx(_components.a,{href:`/guides/auth/customize-connect-ui`,children:`customize Connect UI or build a custom UI`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Credential management`}),` — Encrypted storage, automatic refresh, retrieval at scale. Combine with `,_jsx(_components.a,{href:`/guides/platform/proxy-requests`,children:`Proxy`}),` or `,_jsx(_components.a,{href:`/guides/functions/functions-guide`,children:`Functions`}),` to avoid handling credentials directly.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Observability`}),` — Failure detection, reconnect flow, and per-connection logs.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`guide`,children:`Guide`}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Using a coding agent?`}),` Set up the `,_jsx(_components.a,{href:`/getting-started/coding-agent-setup#docs-mcp-server`,children:`docs MCP`}),` and `,_jsx(_components.a,{href:`/getting-started/coding-agent-setup#skills`,children:`skills`}),`, then copy this page as prompt.`]})}),`\n`,_jsxs(Steps,{children:[_jsxs(Step,{id:`create-nango-account`,title:`Create a Nango account`,children:[_jsxs(_components.p,{children:[`Sign up for free (no credit card): `,_jsxs(_components.a,{href:`https://app.nango.dev/signup`,children:[` `,_jsx(OptimizedImage,{src:`https://mintcdn.com/nango/j_KlSFFzpkqEkMa3/images/nango-deploy-button.svg?fit=max\u0026auto=format\u0026n=j_KlSFFzpkqEkMa3\u0026q=85\u0026s=85918905fcd071a6d5a0d6327c09d5fc`,alt:`Try Nango Cloud`,\"data-og-width\":`215`,width:`215`,\"data-og-height\":`44`,height:`44`,\"data-path\":`images/nango-deploy-button.svg`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/nango/j_KlSFFzpkqEkMa3/images/nango-deploy-button.svg?w=280\u0026fit=max\u0026auto=format\u0026n=j_KlSFFzpkqEkMa3\u0026q=85\u0026s=ce587be66157086cf18591de403c8033 280w, https://mintcdn.com/nango/j_KlSFFzpkqEkMa3/images/nango-deploy-button.svg?w=560\u0026fit=max\u0026auto=format\u0026n=j_KlSFFzpkqEkMa3\u0026q=85\u0026s=f530c036c80d1b2177e696696bf17f4c 560w, https://mintcdn.com/nango/j_KlSFFzpkqEkMa3/images/nango-deploy-button.svg?w=840\u0026fit=max\u0026auto=format\u0026n=j_KlSFFzpkqEkMa3\u0026q=85\u0026s=29d22bdb1995b0367338b6220b161eb2 840w, https://mintcdn.com/nango/j_KlSFFzpkqEkMa3/images/nango-deploy-button.svg?w=1100\u0026fit=max\u0026auto=format\u0026n=j_KlSFFzpkqEkMa3\u0026q=85\u0026s=598c6fd7dbc3d1935e09e885378355b2 1100w, https://mintcdn.com/nango/j_KlSFFzpkqEkMa3/images/nango-deploy-button.svg?w=1650\u0026fit=max\u0026auto=format\u0026n=j_KlSFFzpkqEkMa3\u0026q=85\u0026s=3248b20dc99071d5bae80b048f5e5f54 1650w, https://mintcdn.com/nango/j_KlSFFzpkqEkMa3/images/nango-deploy-button.svg?w=2500\u0026fit=max\u0026auto=format\u0026n=j_KlSFFzpkqEkMa3\u0026q=85\u0026s=e3be9fcc873fb93946c0164ca78ffe2d 2500w`})]})]}),_jsxs(Accordion,{title:`For agents`,id:`for-agents`,children:[_jsxs(_components.p,{children:[`Signup cannot be automated. Ask the user to sign up at `,_jsx(_components.a,{href:`https://app.nango.dev/signup`,children:`app.nango.dev/signup`}),` and provide their Nango API key from the Environment settings tab > API Keys. Use it as `,_jsx(_components.code,{children:`Authorization: Bearer \u003cNANGO-API-KEY>`}),` in API requests.`]}),_jsx(_components.p,{children:`The default API key created on signup has full access and is the simplest option.`}),_jsxs(_components.p,{children:[`If the user creates a scoped API key instead, this guide needs `,_jsx(_components.code,{children:`environment:integrations:create`}),` (step 2) and `,_jsx(_components.code,{children:`environment:connect_sessions:write`}),` (steps 5 and 8). See `,_jsx(_components.a,{href:`/reference/backend/http-api/api-keys`,children:`API keys`}),`.`]})]})]}),_jsxs(Step,{id:`create-integration`,title:`Create an integration`,children:[_jsxs(_components.p,{children:[`In the dashboard, open the `,_jsx(_components.a,{href:`https://app.nango.dev/dev/integrations`,children:`Integrations`}),` tab, click `,_jsx(_components.strong,{children:`Configure New Integration`}),`, and pick the API.`]}),_jsxs(Tip,{children:[`Each API has a dedicated `,_jsx(_components.a,{href:`/integrations/overview`,children:`Nango documentation page`}),` with setup notes and gotchas.`]}),_jsxs(Accordion,{title:`⚠️ OAuth app setup`,id:`oauth-app-setup`,children:[_jsxs(_components.p,{children:[`OAuth APIs require an OAuth developer app registered with the provider. Register one on the provider’s developer portal, use the `,_jsx(_components.code,{children:`Callback URL`}),` shown in your Nango integration settings, then paste the `,_jsx(_components.code,{children:`Client ID`}),` and `,_jsx(_components.code,{children:`Client Secret`}),` back into Nango. Register any required scopes too.`]}),_jsx(_components.p,{children:`If this integration will be used in production, complete the optional custom callback URL step below before real users connect. Retrofitting a callback URL later requires updating the provider app and can break new authorization or reconnect flows until the provider and Nango settings match.`}),_jsxs(_components.p,{children:[`For OAuth 2.0 providers, Nango shows `,_jsx(_components.strong,{children:`suggested scopes`}),` — auto-discovered and refreshed at least monthly. They’re suggestions; you can use any scope the provider supports.`]}),_jsx(Note,{children:_jsxs(_components.p,{children:[`For popular APIs, Nango provides pre-approved OAuth apps. They work in production, but we recommend registering your own OAuth app before you go live — see `,_jsx(_components.a,{href:`#nango-managed-oauth-apps`,children:`Nango-managed OAuth apps`}),` below.`]})})]}),_jsxs(Accordion,{title:`For agents`,id:`for-agents-1`,children:[_jsxs(_components.p,{children:[`Create the integration with the API. If you need the provider slug first, list providers and use the matching provider’s `,_jsx(_components.code,{children:`name`}),` field:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` GET`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.nango.dev/providers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003cNANGO-API-KEY>'`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`For OAuth providers, walk the user through registering an OAuth developer app on the provider’s portal: link them to the provider’s OAuth-app creation page, tell them which `,_jsx(_components.code,{children:`Callback URL`}),` to paste (visible in the Nango integration settings after creation), and ask them to send back the `,_jsx(_components.code,{children:`client_id`}),` and `,_jsx(_components.code,{children:`client_secret`}),` so you can pass them in the request body.`]}),_jsxs(Tabs,{children:[_jsx(Tab,{title:`cURL (OAuth2)`,id:`curl-oauth2`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.nango.dev/integrations`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003cNANGO-API-KEY>'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --data`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"unique_key\": \"\u003cINTEGRATION-ID>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"provider\": \"\u003cPROVIDER>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"credentials\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"type\": \"OAUTH2\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"client_id\": \"\u003cCLIENT-ID>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"client_secret\": \"\u003cCLIENT-SECRET>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"scopes\": \"\u003cSCOPE-1>,\u003cSCOPE-2>\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})})}),_jsx(Tab,{title:`cURL (API key / basic)`,id:`curl-api-key-%2F-basic`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.nango.dev/integrations`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003cNANGO-API-KEY>'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --data`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"unique_key\": \"\u003cINTEGRATION-ID>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"provider\": \"\u003cPROVIDER>\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})})})]}),_jsxs(_components.p,{children:[`For all fields and response shapes, see the `,_jsx(_components.a,{href:`/reference/backend/http-api/providers/list`,children:`List all providers API`}),`, `,_jsx(_components.a,{href:`/reference/backend/http-api/integration/create`,children:`Create an integration API`}),`, and `,_jsx(_components.a,{href:`/reference/backend/http-api/integration/update`,children:`Update an integration API`}),`.`]})]})]}),_jsxs(Step,{id:`test-authorization`,title:`Test the authorization`,children:[_jsxs(_components.p,{children:[`In the `,_jsx(_components.a,{href:`https://app.nango.dev/dev/connections`,children:`Connections`}),` tab, click `,_jsx(_components.strong,{children:`Add Test Connection`}),`, pick your integration, and authorize using a test account. The new connection’s credentials appear in its `,_jsx(_components.em,{children:`Authorization`}),` tab — securely stored and automatically refreshed.`]}),_jsxs(Accordion,{title:`For agents`,id:`for-agents-2`,children:[_jsxs(_components.p,{children:[`Skip the dashboard. Create a connect session and share the returned `,_jsx(_components.code,{children:`connect_link`}),` with the user — they authorize using their test account in the browser, no UI needed on your side:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.nango.dev/connect/sessions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003cNANGO-API-KEY>'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --data`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"tags\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"end_user_id\": \"\u003cTEST-USER-ID>\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"allowed_integrations\": [\"\u003cINTEGRATION-ID>\"]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsxs(_components.p,{children:[`The response contains a `,_jsx(_components.code,{children:`connect_link`}),` (valid 30 minutes). Send it to the user; once they complete authorization, confirm with `,_jsx(_components.code,{children:`GET /connections`}),`. See `,_jsx(_components.a,{href:`/guides/auth/share-connect-link`,children:`Share a connect link`}),`.`]})]})]}),_jsxs(Step,{id:`configure-custom-oauth-callback-url`,title:`Configure a custom OAuth callback URL (optional, recommended)`,children:[_jsx(_components.p,{children:`For production OAuth apps, a callback URL on your own domain is recommended. Some providers show the callback domain to users.`}),_jsx(`a`,{id:`custom-oauth-callback-url-optional`}),_jsx(_components.p,{children:`To configure a custom callback URL:`}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Add an endpoint on your domain (e.g. `,_jsx(_components.code,{children:`https://example.com/oauth-callback`}),`) that `,_jsx(_components.strong,{children:`308-redirects`}),` to `,_jsx(_components.code,{children:`https://api.nango.dev/oauth/callback`}),`, preserving all query parameters.`]}),`\n`,_jsx(_components.li,{children:`Update the registered callback URL with each API provider — otherwise they’ll reject new authorization flows.`}),`\n`,_jsxs(_components.li,{children:[`After confirming steps 1 and 2, update the callback URL in Nango’s `,_jsx(_components.strong,{children:`Environment Settings`}),`. Settings are per-environment, so repeat for every environment.`]}),`\n`]}),_jsx(Accordion,{title:`For agents`,id:`for-agents-3`,children:_jsxs(_components.p,{children:[`Ask the user what production callback URL they want to use, then have them add a 308 redirect from that URL to `,_jsx(_components.code,{children:`https://api.nango.dev/oauth/callback`}),` before they register provider OAuth apps. You can set `,_jsx(_components.code,{children:`callback_url`}),` when creating an environment from `,_jsx(_components.a,{href:`/reference/backend/http-api/environments/create`,children:`the public endpoint`}),`. Ask the user for an `,_jsx(_components.a,{href:`https://app.nango.dev/api-keys`,children:`Account API key`}),` and send it as `,_jsx(_components.code,{children:`Authorization: Bearer \u003cNANGO-API-KEY>`}),`. Updating an existing environment’s callback URL is dashboard-only — ask the user to paste the final callback URL into `,_jsx(_components.strong,{children:`Environment Settings > Backend`}),`.`]})})]}),_jsxs(Step,{id:`generate-session-token`,title:`Generate a session token (backend)`,children:[_jsxs(_components.p,{children:[`Set up a backend endpoint that your frontend will call before each authorization attempt to retrieve a session token from Nango (`,_jsx(_components.a,{href:`/reference/backend/http-api/connect/sessions/create`,children:`API`}),` / `,_jsx(_components.a,{href:`/reference/backend/backend-sdk/node#create-a-connect-session`,children:`Node SDK`}),`).`]}),_jsxs(_components.p,{children:[`You’ll need an `,_jsx(_components.a,{href:`/reference/backend/http-api/api-keys`,children:`API key`}),` with the `,_jsx(_components.code,{children:`environment:connect_sessions:write`}),` scope (find it in `,_jsx(_components.strong,{children:`Environment Settings > API Keys`}),`).`]}),_jsxs(Tabs,{children:[_jsx(Tab,{title:`Node`,id:`node`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Nango`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@nangohq/node'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` nango`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Nango`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apiKey:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`NANGO_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`api`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`post`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'/sessionToken'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` nango`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`createConnectSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` tags:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` end_user_id:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '\u003cEND-USER-ID>'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` end_user_email:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '\u003cEND-USER-EMAIL>'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` organization_id:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '\u003cORGANIZATION-ID>'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` allowed_integrations:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'\u003cINTEGRATION-ID>'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`status`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`200`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`send`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`sessionToken:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})}),_jsx(Tab,{title:`cURL`,id:`curl-2`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.nango.dev/connect/sessions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003cNANGO-API-KEY>'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --data`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"tags\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"end_user_id\": \"\u003cEND-USER-ID>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"end_user_email\": \"\u003cEND-USER-EMAIL>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"organization_id\": \"\u003cORGANIZATION-ID>\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"allowed_integrations\": [\"\u003cINTEGRATION-ID>\"]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})})})]}),_jsxs(Accordion,{title:`ℹ️ Tags`,id:`tags`,children:[_jsxs(_components.p,{children:[`Tags reconcile Nango’s auth-success webhook with the right user, org, or entity in your system. Most apps start with: `,_jsx(_components.code,{children:`end_user_id`}),`, `,_jsx(_components.code,{children:`end_user_email`}),`, `,_jsx(_components.code,{children:`organization_id`}),`.`]}),_jsxs(_components.p,{children:[`Tags are also useful for filtering connections via the API and are displayed in the Nango UI. Set the reserved UI tag keys `,_jsx(_components.code,{children:`end_user_display_name`}),` and `,_jsx(_components.code,{children:`end_user_email`}),` to populate the connections list and connection detail page.`]}),_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/guides/auth/connection-tags-configuration-metadata`,children:`Connection tags, configuration, and metadata`}),` for more.`]})]}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`allowed_integrations`}),` controls what the user sees:`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Multiple integrations`}),` — Connect UI shows a picker.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Single integration`}),` — Connect UI sends the user straight to its auth flow.`]}),`\n`]})]}),_jsxs(Step,{id:`trigger-auth-flow`,title:`Trigger the auth flow (frontend)`,children:[_jsx(_components.p,{children:`Load the Nango frontend SDK, fetch the session token from your backend, and open Connect UI:`}),_jsx(Frame,{caption:`Connect UI authorization flow`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/nango/AX1oSxxgTaIv9K8E/images/screenshots/connect-ui.gif?s=e00e547fa496a121a9abef98ba8466b4`,alt:``,\"data-og-width\":`1920`,width:`1920`,\"data-og-height\":`832`,height:`832`,\"data-path\":`images/screenshots/connect-ui.gif`,\"data-optimize\":`true`,\"data-opv\":`3`})}),_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Nango`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@nangohq/frontend'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` nango`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Nango`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` connect`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` nango`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`openConnectUI`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` onEvent`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'close'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Modal closed.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'connect'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Auth flow successful.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` res`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'/sessionToken'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'POST'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`connect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`setSessionToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`sessionToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// A loading indicator shows until this is set.`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`See the `,_jsx(_components.a,{href:`/reference/frontend/frontend-sdk#connect-using-nango-connect-ui`,children:`Frontend SDK reference`}),` for more options.`]}),_jsxs(_components.p,{children:[`The pre-built Connect UI is recommended but optional — if you need full UX control, follow `,_jsx(_components.a,{href:`/guides/auth/customize-connect-ui`,children:`Customize Connect UI`}),`. For email/cross-device flows, see `,_jsx(_components.a,{href:`/guides/auth/share-connect-link`,children:`Share a connect link`}),`.`]})]}),_jsxs(Step,{id:`save-connection-id-from-webhook`,title:`Listen for webhooks \u0026 save the connection ID (backend)`,children:[_jsxs(_components.p,{children:[`When authorization succeeds, Nango generates a unique `,_jsx(_components.strong,{children:`connection ID`}),`. You use this ID to manage the connection and retrieve its credentials. `,_jsx(_components.strong,{children:`You must store it on your side`}),`, attached to the user/org/project that owns the connection — Nango doesn’t model that ownership.`]}),_jsxs(_components.p,{children:[`Set up the webhook in `,_jsx(_components.strong,{children:`Environment Settings`}),`:`]}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Specify a `,_jsx(_components.strong,{children:`Webhook URL`}),` in the Nango UI.`]}),`\n`,_jsxs(_components.li,{children:[`Enable `,_jsx(_components.strong,{children:`Send New Connection Creation Webhooks`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Handle `,_jsx(_components.code,{children:`POST`}),` requests on that route in your backend.`]}),`\n`]}),_jsx(Accordion,{title:`For agents`,id:`for-agents-4`,children:_jsxs(_components.p,{children:[`Webhook URL configuration is dashboard-only — there is no public API to set environment webhook URLs. Ask the user to paste the webhook URL into `,_jsx(_components.strong,{children:`Environment Settings`}),` and enable `,_jsx(_components.strong,{children:`Send New Connection Creation Webhooks`}),`.`]})}),_jsx(_components.p,{children:`Webhook payload:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"auth\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"operation\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"creation\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"connectionId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cCONNECTION-ID>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"tags\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"end_user_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cEND-USER-ID>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"end_user_email\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cEND-USER-EMAIL>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"organization_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cORGANIZATION-ID>\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Persist `,_jsx(_components.code,{children:`connectionId`}),` against whichever entity owns the connection in your app.`]})]}),_jsxs(Step,{id:`build-reauthorization`,title:`Build re-authorization`,children:[_jsx(_components.p,{children:`Credentials can become invalid when users revoke access, providers rotate refresh tokens, scopes change, or an app moves from testing to production. Re-authorization updates an existing connection’s credentials while preserving its data and config. Deleting and re-creating the connection wipes that data — prefer re-authorization.`}),_jsxs(_components.p,{children:[`Before showing integration settings, check the connection with `,_jsx(_components.code,{children:`GET /connections/{connectionId}`}),`:`]}),_jsxs(Tabs,{children:[_jsx(Tab,{title:`Node`,id:`node-2`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Nango`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@nangohq/node'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` nango`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Nango`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apiKey:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`NANGO_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` nango`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getConnection`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'\u003cINTEGRATION-ID>'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'\u003cCONNECTION-ID>'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Connection is valid.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`} `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`code`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'invalid_credentials'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Connection is invalid — show a Reconnect button.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` displayReconnectUI`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})}),_jsx(Tab,{title:`cURL`,id:`curl-3`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` GET`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.nango.dev/connections/\u003cCONNECTION-ID>?provider_config_key=\u003cINTEGRATION-ID>'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003cNANGO-API-KEY>'`})]}),`\n`]})})})})]}),_jsxs(_components.p,{children:[`An `,_jsx(_components.code,{children:`invalid_credentials`}),` error means the connection failed credential refresh or validation — show an error state with a `,_jsx(_components.strong,{children:`Reconnect`}),` button.`]}),_jsxs(_components.p,{children:[`To trigger re-authorization, use the same frontend flow as a new connection, but generate a reconnect session token on the backend. Pass the returned token to the Frontend SDK exactly like a normal session token. On success you’ll receive an `,_jsx(_components.code,{children:`auth`}),` webhook with `,_jsx(_components.code,{children:`operation = override`}),`.`]}),_jsxs(_components.p,{children:[`The connection keeps its connection ID. It also keeps its tags, unless the reconnect session passes non-empty `,_jsx(_components.code,{children:`tags`}),` or an `,_jsx(_components.code,{children:`end_user`}),`, which replace them.`]}),_jsxs(Tabs,{children:[_jsx(Tab,{title:`Node`,id:`node-3`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Nango`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@nangohq/node'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` nango`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Nango`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apiKey:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`NANGO_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`api`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`post`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'/sessionToken'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` nango`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`createReconnectSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` connection_id:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '\u003cCONNECTION-ID>'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` integration_id:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '\u003cINTEGRATION-ID>'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`status`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`200`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`send`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`sessionToken:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})}),_jsx(Tab,{title:`cURL`,id:`curl-4`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.nango.dev/connect/sessions/reconnect`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003cNANGO-API-KEY>'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --data`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"connection_id\": \"\u003cCONNECTION-ID>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"integration_id\": \"\u003cINTEGRATION-ID>\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})})})]})]}),_jsxs(Step,{id:`run-auth-flow`,title:`Run the flow`,children:[_jsxs(_components.p,{children:[`Test the auth flow from your app and verify a connection appears in the `,_jsx(_components.a,{href:`https://app.nango.dev/dev/connections`,children:`Connections`}),` tab. Failed attempts are inspectable in the `,_jsx(_components.strong,{children:`Logs`}),` tab.`]}),_jsxs(Accordion,{title:`For agents`,id:`for-agents-5`,children:[_jsxs(_components.p,{children:[`After the user runs the flow, confirm the connection was created with `,_jsx(_components.a,{href:`/reference/backend/http-api/connections/list`,children:_jsx(_components.code,{children:`GET /connections`})}),` — filter by the tags you set in step 5:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` GET`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.nango.dev/connections?tags[end_user_id]=\u003cEND-USER-ID>'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003cNANGO-API-KEY>'`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`Auth logs are dashboard-only — if the call returns no connection, ask the user to check the `,_jsx(_components.strong,{children:`Logs`}),` tab for the failure reason.`]})]}),_jsxs(_components.p,{children:[`🎉 `,_jsx(_components.strong,{children:`You are connected!`}),` Next:`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`View connections and credentials in the `,_jsx(_components.strong,{children:`Connections`}),` tab.`]}),`\n`,_jsxs(_components.li,{children:[`Retrieve credentials via the `,_jsx(_components.a,{href:`/reference/backend/http-api/connections/get`,children:`API`}),` or `,_jsx(_components.a,{href:`/reference/backend/backend-sdk/node#get-a-connection-with-credentials`,children:`Node SDK`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Build with `,_jsx(_components.a,{href:`/guides/functions/syncs/sync-functions`,children:`sync functions`}),`, `,_jsx(_components.a,{href:`/guides/functions/action-functions`,children:`Action functions`}),`, `,_jsx(_components.a,{href:`/guides/functions/webhook-functions`,children:`webhook functions`}),`, or any other Nango function type.`]}),`\n`]})]})]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Questions, problems, feedback?`}),` Reach out in the `,_jsx(_components.a,{href:`https://nango.dev/slack`,children:`Slack community`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`nango-managed-oauth-apps`,children:`Nango-managed OAuth apps`}),`\n`,_jsx(_components.p,{children:`Nango provides pre-approved OAuth apps for popular APIs such as Gmail, Outlook, Salesforce, and HubSpot. Use them to test connections without registering an app with the provider.`}),`\n`,_jsx(_components.p,{children:`Nango-managed apps work in production, but we recommend registering your own OAuth app before you go live:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Whitelabel auth`}),` — with a Nango-managed app, the consent screen shows Nango, not your product.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Scopes`}),` — Nango-managed apps have fixed scopes. Your own app can request any scope the provider offers.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Callback URL`}),` — Nango-managed apps use Nango’s callback URL. Your own app can use a `,_jsx(_components.a,{href:`#custom-oauth-callback-url-optional`,children:`custom callback URL`}),` on your domain.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Marketplace listings`}),` — provider marketplaces require your own app.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`API features`}),` — some provider features are only available to first-party apps.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Revocation risk`}),` — most providers don’t allow shared credentials. If a provider revokes a Nango-managed app, every connection using it stops working.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Portability`}),` — only with your own app can you export access and refresh tokens and move off Nango without users re-authorizing.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`These tradeoffs apply to shared OAuth apps from any auth platform, not just Nango.`}),`\n`,_jsxs(_components.p,{children:[`To make registering your own app easier, Nango maintains step-by-step setup guides for most OAuth APIs in `,_jsx(_components.a,{href:`/integrations/overview`,children:`APIs \u0026 Integrations`}),`, for example `,_jsx(_components.a,{href:`/api-integrations/google-mail/how-to-register-your-own-gmail-api-oauth-app`,children:`Gmail`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`related-guides`,children:`Related guides`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/guides/auth/share-connect-link`,children:`Share a connect link`}),` - send authorization links by email, support tools, or cross-device flows.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/guides/auth/connection-tags-configuration-metadata`,children:`Connection tags, configuration, and metadata`}),` - store the right connection-level data in the right field.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/guides/auth/customize-connect-ui`,children:`Customize Connect UI`}),` - customize branding or build your own authorization UI.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/guides/auth/token-refreshing`,children:`Token refreshing and validity`}),` - handle revoked or expired credentials.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Auth guide","sidebarTitle":"Auth guide","description":"Let your users connect external APIs to your agents \u0026 apps.","href":"/guides/auth/auth-guide"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[]},{"title":"How it works","slug":"how-it-works","depth":2,"children":[]},{"title":"Capabilities","slug":"capabilities","depth":2,"children":[]},{"title":"Guide","slug":"guide","depth":2,"children":[]},{"title":"Nango-managed OAuth apps","slug":"nango-managed-oauth-apps","depth":2,"children":[]},{"title":"Related guides","slug":"related-guides","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/nango/66b2950062f9d11d/custom.js"],"subdomain":"nango","siteName":"Nango Docs","title":"Auth guide - Nango Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-26T20:24:56.456Z","originalFileLocation":"guides/auth/auth-guide.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Let your users connect external APIs to your agents \u0026amp; apps.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Nango Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/nango/H6v9PP50zUaxkdQK/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/nango/H6v9PP50zUaxkdQK/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/nango/H6v9PP50zUaxkdQK/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/nango/H6v9PP50zUaxkdQK/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/nango/H6v9PP50zUaxkdQK/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/nango/H6v9PP50zUaxkdQK/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/nango/H6v9PP50zUaxkdQK/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/nango/H6v9PP50zUaxkdQK/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/nango/H6v9PP50zUaxkdQK/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Auth guide - Nango Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Let your users connect external APIs to your agents \u0026amp; apps.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Nango Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://nango.dev/docs/guides/auth/auth-guide\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://nango.mintlify.app/_mintlify/api/og/v2?division=Auth\u0026amp;title=Auth+guide\u0026amp;description=Let+your+users+connect+external+APIs+to+your+agents+%26+apps.\u0026amp;theme=79d4473b17677a097a22660e\u0026amp;signature=acf9ddba066ef73c0a0297d5d4fb288416283735db9575b492f9f3d636c3eb95\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Auth guide - Nango Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Let your users connect external APIs to your agents \u0026amp; apps.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://nango.mintlify.app/_mintlify/api/og/v2?division=Auth\u0026amp;title=Auth+guide\u0026amp;description=Let+your+users+connect+external+APIs+to+your+agents+%26+apps.\u0026amp;theme=79d4473b17677a097a22660e\u0026amp;signature=acf9ddba066ef73c0a0297d5d4fb288416283735db9575b492f9f3d636c3eb95\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/nango/H6v9PP50zUaxkdQK/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Nango Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#29abe2\">\u003clink data-mint-head rel=\"canonical\" href=\"https://nango.dev/docs/guides/auth/auth-guide\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/guides/auth/auth-guide.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://nango.dev/#organization\",\"name\":\"Nango Docs\",\"url\":\"https://nango.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/nango/h2zzveDlAs05T6zr/images/Nango-Light-Mode.svg?fit=max\u0026auto=format\u0026n=h2zzveDlAs05T6zr\u0026q=85\u0026s=0c2845b2219705011e11ef4985aa9d91\"}},{\"@type\":\"WebSite\",\"@id\":\"https://nango.dev/docs#website\",\"name\":\"Nango Docs\",\"url\":\"https://nango.dev/docs\",\"publisher\":{\"@id\":\"https://nango.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://nango.dev/docs/guides/auth/auth-guide#webpage\",\"url\":\"https://nango.dev/docs/guides/auth/auth-guide\",\"name\":\"Auth guide\",\"description\":\"Let your users connect external APIs to your agents \u0026 apps.\",\"dateModified\":\"2026-10-26T20:24:56.456Z\",\"isPartOf\":{\"@id\":\"https://nango.dev/docs#website\"},\"breadcrumb\":{\"@id\":\"https://nango.dev/docs/guides/auth/auth-guide#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://nango.dev/docs/guides/auth/auth-guide#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Nango Docs\",\"item\":\"https://nango.dev/docs\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Auth guide\",\"item\":\"https://nango.dev/docs/guides/auth/auth-guide\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://nango.dev/docs/guides/auth/auth-guide#article\",\"headline\":\"Auth guide\",\"name\":\"Auth guide\",\"description\":\"Let your users connect external APIs to your agents \u0026 apps.\",\"url\":\"https://nango.dev/docs/guides/auth/auth-guide\",\"mainEntityOfPage\":{\"@id\":\"https://nango.dev/docs/guides/auth/auth-guide#webpage\"},\"dateModified\":\"2026-10-26T20:24:56.456Z\",\"publisher\":{\"@id\":\"https://nango.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://nango.dev/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Nango Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Nango Docs","nav":{"global":null,"tabs":[{"tab":"Documentation","icon":"book-open","groups":[{"group":"Getting started","pages":[{"title":"Introduction","sidebarTitle":"Introduction","href":"/getting-started/intro-to-nango"},{"title":"Quickstart","sidebarTitle":"🚀 Quickstart","href":"/getting-started/quickstart"},{"title":"Coding agent setup","sidebarTitle":"✨ Coding agent setup","href":"/getting-started/coding-agent-setup"},{"group":"Use cases","expanded":false,"pages":[{"title":"Tool calling for AI agents","sidebarTitle":"Tool calling for AI agents","href":"/getting-started/use-cases/tool-calling"},{"title":"Sync external API data","sidebarTitle":"Sync external API data","href":"/getting-started/use-cases/syncs"},{"title":"Run external API operations","sidebarTitle":"Run external API operations","href":"/getting-started/use-cases/actions"},{"title":"Process external webhooks","sidebarTitle":"Process external webhooks","href":"/getting-started/use-cases/webhooks-from-external-apis"},{"title":"Build a unified API","sidebarTitle":"Build a unified API","href":"/getting-started/use-cases/unified-apis"},{"title":"Customize per customer","sidebarTitle":"Customize per customer","href":"/getting-started/use-cases/customer-configuration"},{"title":"React to connection lifecycle events","sidebarTitle":"Connection lifecycle events","href":"/getting-started/use-cases/implement-event-handler"},{"title":"Sample app","sidebarTitle":"Sample app","description":"A practical demonstration of integrating Nango in your codebase.","href":"/getting-started/use-cases/sample-app"}]}]},{"group":"Guides","pages":[{"group":"Auth","expanded":false,"pages":[{"title":"Auth guide","sidebarTitle":"Auth guide","href":"/guides/auth/auth-guide"},{"title":"Share a connect link","sidebarTitle":"Share a connect link","description":"Generate a short-lived connect link and share it with your end user.","href":"/guides/auth/share-connect-link"},{"title":"Connection tags, configuration, and metadata","sidebarTitle":"Tags, configuration \u0026 metadata","href":"/guides/auth/connection-tags-configuration-metadata"},{"title":"Customize Connect UI","sidebarTitle":"Customize Connect UI","href":"/guides/auth/customize-connect-ui"},{"title":"Token refreshing \u0026 validity","sidebarTitle":"Token refreshing \u0026 validity","href":"/guides/auth/token-refreshing"},{"title":"MCP Auth","sidebarTitle":"MCP Auth","href":"/guides/auth/mcp-auth"}]},{"title":"Agent sessions","sidebarTitle":"Agent sessions","href":"/guides/agent-sessions"},{"group":"Functions","expanded":false,"pages":[{"title":"Functions guide","sidebarTitle":"Functions guide","href":"/guides/functions/functions-guide"},{"group":"Sync functions","pages":[{"title":"Sync function guide","sidebarTitle":"Sync function guide","href":"/guides/functions/syncs/sync-functions"},{"title":"Sync efficiency","sidebarTitle":"Sync efficiency","href":"/guides/functions/syncs/sync-efficiency"},{"title":"Checkpoints","sidebarTitle":"Checkpoints","href":"/guides/functions/syncs/checkpoints"},{"title":"Records cache","sidebarTitle":"Records cache","href":"/guides/functions/syncs/records-cache"},{"title":"Deletion detection","sidebarTitle":"Deletion detection","href":"/guides/functions/syncs/deletion-detection"},{"title":"Real-time syncs with webhooks","sidebarTitle":"Real-time syncs","href":"/guides/functions/syncs/realtime-syncs"},{"title":"Sync partitioning","sidebarTitle":"Sync partitioning","href":"/guides/functions/syncs/sync-partitioning"}]},{"title":"Action functions","sidebarTitle":"Action functions","href":"/guides/functions/action-functions"},{"title":"Webhook functions","sidebarTitle":"Webhook functions","href":"/guides/functions/webhook-functions"},{"title":"Event functions","sidebarTitle":"Event functions","href":"/guides/functions/event-functions"},{"title":"Storage","sidebarTitle":"Storage","href":"/guides/functions/storage"},{"title":"Function logging","sidebarTitle":"Logging","href":"/guides/functions/logging"},{"title":"Rate limits","sidebarTitle":"Rate limits","href":"/guides/functions/rate-limits"},{"title":"Data validation","sidebarTitle":"Data validation","href":"/guides/functions/data-validation"},{"title":"Testing integrations","sidebarTitle":"Testing","href":"/guides/functions/testing"},{"title":"CI/CD for Nango Functions","sidebarTitle":"CI/CD","href":"/guides/functions/ci-cd"},{"title":"Unified APIs with functions","sidebarTitle":"Unified APIs","href":"/guides/functions/unified-apis"}]},{"group":"Platform","expanded":false,"pages":[{"title":"Observability","sidebarTitle":"Observability","href":"/guides/platform/observability"},{"title":"Environments","sidebarTitle":"Environments","href":"/guides/platform/environments"},{"title":"Limits","sidebarTitle":"Limits","href":"/guides/platform/limits"},{"title":"Security","sidebarTitle":"Security","href":"/guides/platform/security"},{"title":"Audit trail","sidebarTitle":"Audit trail","href":"/guides/platform/audit-trail"},{"title":"Proxy requests","sidebarTitle":"Proxy requests","href":"/guides/platform/proxy-requests"},{"title":"Receive webhooks from Nango","sidebarTitle":"Webhooks from Nango","href":"/guides/platform/webhooks-from-nango"},{"title":"External webhook forwarding","sidebarTitle":"External webhook forwarding","href":"/guides/platform/webhook-forwarding"},{"title":"Common issues","sidebarTitle":"Common issues","href":"/guides/platform/common-issues"},{"group":"Self-Hosting","pages":[{"title":"Self-host Nango","sidebarTitle":"Overview","href":"/guides/platform/self-hosting/self-hosting"},{"title":"BYOC","sidebarTitle":"BYOC","href":"/guides/platform/self-hosting/byoc"},{"title":"Self-Managed","sidebarTitle":"Self-Managed","href":"/guides/platform/self-hosting/self-managed"}]},{"group":"Migrations","pages":[{"title":"Migrate to checkpoints","sidebarTitle":"Migrate to checkpoints","href":"/guides/platform/migrations/migrate-to-checkpoints"},{"title":"Migrate from end user","sidebarTitle":"Migrate from end user","href":"/guides/platform/migrations/migrate-from-end-user"},{"title":"Migrate from public key","sidebarTitle":"Migrate from public key","href":"/guides/platform/migrations/migrate-from-public-key"},{"title":"Migrate from Connection MCP to agent sessions","sidebarTitle":"Migrate from Connection MCP","href":"/guides/platform/migrations/migrate-from-connection-mcp"},{"title":"Migrating to Zero YAML","sidebarTitle":"Migrating to Zero YAML","href":"/guides/platform/migrations/migrate-to-zero-yaml"}]},{"title":"Contributing to Nango","sidebarTitle":"Contributing","href":"/contributing"}]}]},{"group":"Reference","pages":[{"group":"Frontend","pages":[{"title":"Frontend SDK","sidebarTitle":"Frontend SDK","icon":"js","href":"/reference/frontend/frontend-sdk"}]},{"group":"Backend","pages":[{"group":"HTTP API","icon":"cloud","pages":[{"title":"API keys","sidebarTitle":"API keys","href":"/reference/backend/http-api/api-keys"},{"title":"Authentication","href":"/reference/backend/http-api/authentication"},{"title":"Rate limits","href":"/reference/backend/http-api/rate-limits"},{"group":"Environments","pages":[{"title":"List environments","openapi":"GET /environments","href":"/reference/backend/http-api/environments/list"},{"title":"Get an environment","openapi":"GET /environments/{environmentUuid}","href":"/reference/backend/http-api/environments/get"},{"title":"Create an environment","openapi":"POST /environments","href":"/reference/backend/http-api/environments/create"},{"title":"Delete an environment","openapi":"DELETE /environments/{environmentUuid}","href":"/reference/backend/http-api/environments/delete"},{"title":"List environment API keys","openapi":"GET /environments/{environmentUuid}/api-keys","href":"/reference/backend/http-api/environments/list-api-keys"},{"title":"Get an environment API key","openapi":"GET /environments/{environmentUuid}/api-keys/{keyUuid}","href":"/reference/backend/http-api/environments/get-api-key"},{"title":"Create an environment API key","openapi":"POST /environments/{environmentUuid}/api-keys","href":"/reference/backend/http-api/environments/create-api-key"},{"title":"Update an environment API key","openapi":"PATCH /environments/{environmentUuid}/api-keys/{keyUuid}","href":"/reference/backend/http-api/environments/update-api-key"},{"title":"Delete an environment API key","openapi":"DELETE /environments/{environmentUuid}/api-keys/{keyUuid}","href":"/reference/backend/http-api/environments/delete-api-key"},{"title":"Rotate the webhook signing key","openapi":"POST /environment/webhook-signing-key/rotate","href":"/reference/backend/http-api/environments/rotate-webhook-signing-key"}]},{"group":"Integrations","pages":[{"title":"List all integrations","openapi":"GET /integrations","href":"/reference/backend/http-api/integration/list"},{"title":"Get an integration","openapi":"GET /integrations/{uniqueKey}","href":"/reference/backend/http-api/integration/get"},{"title":"Create an integration","openapi":"POST /integrations","href":"/reference/backend/http-api/integration/create"},{"title":"Update an integration","openapi":"PATCH /integrations/{uniqueKey}","href":"/reference/backend/http-api/integration/update"},{"title":"Delete an integration","openapi":"DELETE /integrations/{uniqueKey}","href":"/reference/backend/http-api/integration/delete"}]},{"group":"Connect","pages":[{"title":"Create a connect session","openapi":"POST /connect/sessions","href":"/reference/backend/http-api/connect/sessions/create"},{"title":"Create a reconnect session","openapi":"POST /connect/sessions/reconnect","href":"/reference/backend/http-api/connect/sessions/reconnect"},{"title":"Get a connect session","openapi":"GET /connect/session","href":"/reference/backend/http-api/connect/session/get"},{"title":"Delete a connect session","openapi":"DELETE /connect/session","href":"/reference/backend/http-api/connect/session/delete"}]},{"group":"Connections","pages":[{"title":"Import a connection","openapi":"POST /connections","href":"/reference/backend/http-api/connections/post"},{"title":"List connections","openapi":"GET /connections","href":"/reference/backend/http-api/connections/list"},{"title":"Get connection \u0026 credentials","openapi":"GET /connections/{connectionId}","href":"/reference/backend/http-api/connections/get"},{"title":"Patch a connection","openapi":"PATCH /connections/{connectionId}","href":"/reference/backend/http-api/connections/patch"},{"title":"Set connection metadata","openapi":"POST /connections/metadata","href":"/reference/backend/http-api/connections/set-metadata"},{"title":"Edit connection metadata","openapi":"PATCH /connections/metadata","href":"/reference/backend/http-api/connections/update-metadata"},{"title":"Delete a connection","openapi":"DELETE /connections/{connectionId}","href":"/reference/backend/http-api/connections/delete"}]},{"group":"Functions","pages":[{"title":"List functions","openapi":"GET /integrations/{uniqueKey}/functions","href":"/reference/backend/http-api/functions/list"},{"title":"Get a function","openapi":"GET /integrations/{uniqueKey}/functions/{name}","href":"/reference/backend/http-api/functions/get"},{"title":"Get a function's source code","openapi":"GET /integrations/{uniqueKey}/functions/{name}/code","href":"/reference/backend/http-api/functions/code"},{"title":"Delete a function","openapi":"DELETE /integrations/{uniqueKey}/functions/{name}","href":"/reference/backend/http-api/functions/delete"},{"title":"Compile a function","openapi":"POST /functions/compile","href":"/reference/backend/http-api/functions/compile"},{"title":"Dry run a function","openapi":"POST /functions/dryruns","href":"/reference/backend/http-api/functions/dryruns-create"},{"title":"Get dry run results","openapi":"GET /functions/dryruns/{id}","href":"/reference/backend/http-api/functions/dryruns-get"},{"title":"Create a function deployment","openapi":"POST /functions/deployments","href":"/reference/backend/http-api/functions/deployments-create"},{"title":"Get a function deployment","openapi":"GET /functions/deployments/{id}","href":"/reference/backend/http-api/functions/deployments-get"},{"title":"Get integration functions config","openapi":"GET /scripts/config","href":"/reference/backend/http-api/scripts/config"}]},{"group":"Syncs","pages":[{"title":"Get records","sidebarTitle":"Get records","openapi":"GET /records","href":"/reference/backend/http-api/sync/records-list"},{"title":"Prune records","sidebarTitle":"Prune records","openapi":"PATCH /records/prune","href":"/reference/backend/http-api/sync/prune-records"},{"title":"Trigger sync(s)","openapi":"POST /sync/trigger","href":"/reference/backend/http-api/sync/trigger"},{"title":"Start sync(s)","openapi":"POST /sync/start","href":"/reference/backend/http-api/sync/start"},{"title":"Pause sync(s)","openapi":"POST /sync/pause","href":"/reference/backend/http-api/sync/pause"},{"title":"Sync status","openapi":"GET /sync/status","href":"/reference/backend/http-api/sync/status"},{"title":"Override sync connection frequency","openapi":"PUT /sync/update-connection-frequency","href":"/reference/backend/http-api/sync/update-connection-frequency"},{"title":"Get environment variables","openapi":"GET /environment-variables","href":"/reference/backend/http-api/sync/environment-variables"},{"title":"Create sync variant","sidebarTitle":"Create variant","openapi":"POST /sync/{name}/variant/{variant}","href":"/reference/backend/http-api/sync/create-variant"},{"title":"Delete sync variant","sidebarTitle":"Delete variant","openapi":"DELETE /sync/{name}/variant/{variant}","href":"/reference/backend/http-api/sync/delete-variant"}]},{"group":"Actions","pages":[{"title":"Trigger an action","openapi":"POST /action/trigger","href":"/reference/backend/http-api/action/trigger"}]},{"group":"Proxy","pages":[{"title":"Proxy - GET requests","sidebarTitle":"Proxy - GET requests","openapi":"GET /proxy/{anyPath}","href":"/reference/backend/http-api/proxy/get"},{"title":"Proxy - POST requests","sidebarTitle":"Proxy - POST requests","openapi":"POST /proxy/{anyPath}","href":"/reference/backend/http-api/proxy/post"},{"title":"Proxy - PUT requests","sidebarTitle":"Proxy - PUT requests","openapi":"PUT /proxy/{anyPath}","href":"/reference/backend/http-api/proxy/put"},{"title":"Proxy - PATCH requests","sidebarTitle":"Proxy - PATCH requests","openapi":"PATCH /proxy/{anyPath}","href":"/reference/backend/http-api/proxy/patch"},{"title":"Proxy - DELETE requests","sidebarTitle":"Proxy - DELETE requests","openapi":"DELETE /proxy/{anyPath}","href":"/reference/backend/http-api/proxy/delete"}]},{"group":"Providers","pages":[{"title":"List all providers","openapi":"GET /providers","href":"/reference/backend/http-api/providers/list"},{"title":"Get a provider","openapi":"GET /providers/{provider}","href":"/reference/backend/http-api/providers/get"},{"title":"List provider templates","openapi":"GET /providers/{provider}/templates","href":"/reference/backend/http-api/providers/templates"}]}]},{"group":"Backend SDK","icon":"cubes","pages":[{"title":"Node","sidebarTitle":"Node","icon":"node","href":"/reference/backend/backend-sdk/node"},{"title":"Python","sidebarTitle":"Python","icon":"python","href":"/reference/backend/backend-sdk/python"},{"title":"Java","sidebarTitle":"Java","icon":"java","href":"/reference/backend/backend-sdk/java"},{"title":"Ruby","sidebarTitle":"Ruby","icon":"gem","href":"/reference/backend/backend-sdk/ruby"},{"title":"Go","sidebarTitle":"Go","icon":"golang","href":"/reference/backend/backend-sdk/go"},{"title":"Rust","sidebarTitle":"Rust","icon":"rust","href":"/reference/backend/backend-sdk/rust"},{"title":"PHP","sidebarTitle":"PHP","icon":"php","href":"/reference/backend/backend-sdk/php"}]},{"title":"Management MCP","sidebarTitle":"Management MCP","icon":"https://mintlify.s3.us-west-1.amazonaws.com/nango/images/mcp.svg","href":"/reference/backend/management-mcp"}]},{"group":"Functions","pages":[{"title":"Functions CLI","sidebarTitle":"Functions CLI","icon":"terminal","href":"/reference/functions/functions-cli"},{"title":"Functions SDK","sidebarTitle":"Functions SDK","icon":"code","href":"/reference/functions/functions-sdk"}]}]}]},{"tab":"APIs \u0026 Integrations","icon":"plug","pages":[{"title":"APIs \u0026 Integrations","href":"/integrations/overview"}]},{"tab":"Changelog","icon":"bolt","pages":[{"title":"Changelog","href":"/updates/changelog"}]},{"tab":"Support","icon":"slack","href":"https://nango.dev/slack"}]},"title":"Auth guide - Nango Docs","buildId":"dpl_EARnBX9sYeZdmtDtdMETnj8cZgAL","deploymentId":"dpl_EARnBX9sYeZdmtDtdMETnj8cZgAL","dynamics":["a74be98ba7","07c022d89b"],"chunks":["zoom-image-lightbox-CPKACqoI.js","lightbox-handle-r17bVUz3.js","Frame-BDpbmQLt.js","DynamicMarkdown-a43r1ghB.js"]}