Give your business’s app real user accounts: your visitors sign in with a NanoCorp account, and your app receives their name, email, and picture, with no password handling, no auth service to wire.
Apps built on NanoCorp can offer Sign in with NanoCorp: visitors sign in
with a NanoCorp account (creating one takes seconds), and your app receives
their identity: name, email address, profile picture, and whether they own
this business. One NanoCorp account works across every NanoCorp-built app.
Ask your agent to “enable user auth and add sign-in to the site”. It will
enable the feature, install the SDK, and wire the pages. This page explains
what happens underneath and what you can rely on.
NanoCorp runs the identity service (an OpenID Connect provider at
accounts.nanocorp.so). Your app uses the open-source
@nanocorp/auth package, which
handles the whole flow: the sign-in redirect, the callback, a secure session
cookie on your app’s own domain (7 days), and sign-out.Enabling the feature needs a deployed website. It provisions your app’s credentials and sets six managed
environment variables on your deployment (NANOCORP_AUTH_CLIENT_ID,
NANOCORP_AUTH_CLIENT_SECRET, NANOCORP_AUTH_SESSION_SECRET,
NANOCORP_AUTH_SESSION_SECRET_PREVIOUS, NANOCORP_AUTH_ISSUER,
NANOCORP_AUTH_BASE_URL). They are platform-managed: agents cannot overwrite
them, and secret values are never displayed.
When someone signs in and consents, your app gets: their NanoCorp user id
(stable), name, email address, profile picture, and an is_app_owner flag.
The consent screen tells them exactly that, and that NanoCorp businesses are
built and run with AI agents.
Signed-in users are sign-in identities, not a marketing list. You are
responsible for the personal data your app receives; use it to operate your
product, not for unsolicited outreach (see the Terms of Service).
The Users section in Business settings lists everyone who signed in to
your app, with their last sign-in date. Before the feature is on, it reads “Not
on” and suggests asking your agent to add sign-in. Your agent can read the same
list with the list_app_users tool, or nanocorp auth users in its terminal.
The is_app_owner flag is true only for you (the owner of this business), so
your app can ship an admin area. Rendering can trust the flag; anything that
changes data goes through the SDK’s requireOwner(), which re-checks
ownership live with the platform on every call.
If you sell a monthly plan, Sign in with NanoCorp is what
turns it into a members-only area. Your agent wires these calls from the
@nanocorp/auth package, and each one has one job:
const user = await getUser(); // is the visitor signed in?const subs = await getSubscriptions(user); // do they already pay?const href = await subscribeUrl({ productId }); // the Subscribe buttonawait requireSubscriber(req, { productId }); // guard every paid pageconst manage = await billingPortalUrl({ returnTo }); // the "Cancel plan" buttonconst card = await billingPortalUrl({ returnTo, flow: "update_card" });
requireSubscriber() asks the platform live and fails closed, so it is what
protects the paid pages. subscribeUrl() is computed for the signed-in
visitor at render time, which is why a plan has no copyable buy link. If the
plan cannot be checked right now, the button still works: it starts the
subscription when pressed. The billing link opens the cancel flow by default,
so pass update_card for the button that changes the card. Right after a
payment a members page can still read “not subscribed” for up to two minutes,
so the success page never gates itself.A subscriber is a paying customer of your business, so writing to them about
their plan is fine. The rule above still holds for everyone who only signed in.
The session cookie is bound to your app’s domain. If you attach or change a
custom domain, existing app users are signed out at the next deploy and simply
sign in again. Nothing is lost.
Resetting your app’s sign-in secrets is a recovery step reserved for you, the
business owner. Your agent cannot run it, in any mode, and you should never
hand it your own login or token so that it can.
Install the NanoCorp CLI on your own computer and sign in with
nanocorp login.
Reset the secrets for your business and sign everyone out:
Every signed-in user is signed out once the site redeploys, and simply signs
in again. That is the right call after a leak: a session created with the old
secrets must stop working. For a precautionary reset when nothing leaked, leave
out --revoke-sessions: existing sessions keep working, so your users notice
nothing. Either way, when the previous key cannot be recovered everyone is
signed out, and the reset tells you so.The reset only works with your own login. If it answers “Only the business
owner can reset app sign-in”, the terminal is using a business credential
instead of yours: run it from your own terminal and make sure NANOCORP_TOKEN
is not set there.Need a hand? Write to support@nanocorp.so from
your account email and we will walk you through it.
End-users of NanoCorp-built apps can ask us to delete their NanoCorp account
at support@nanocorp.so.An account that still holds an active plan cannot be deleted: cancel the plan
first, then ask for the deletion.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"NanoCorp","description":"NanoCorp is a platform to create and run autonomous businesses with AI agents. Use the web app at app.nanocorp.so, or connect your own AI agent, such as Claude, ChatGPT, Codex or Meta Muse, to NanoCorp's MCP server at https://mcp.nanocorp.so.","colors":{"primary":"#4E9E94","light":"#69B8AB","dark":"#3D8279"},"logo":{"light":"https://mintcdn.com/nanocorp/dZqX8HJ9SmgTqTHV/logo/light.svg?fit=max\u0026auto=format\u0026n=dZqX8HJ9SmgTqTHV\u0026q=85\u0026s=aed39ea9c96046d224dcf9f9fd48343f","dark":"https://mintcdn.com/nanocorp/dZqX8HJ9SmgTqTHV/logo/dark.svg?fit=max\u0026auto=format\u0026n=dZqX8HJ9SmgTqTHV\u0026q=85\u0026s=5f21a104758df26c67e03022151bfbaa"},"favicon":"https://mintcdn.com/nanocorp/PnkiRYuEH_mtA-wK/favicon.svg?fit=max\u0026auto=format\u0026n=PnkiRYuEH_mtA-wK\u0026q=85\u0026s=1ec86acba7c15252a1c0d4358197c070","appearance":{"default":"system","strict":false},"background":{"color":{"light":"#F7F4F0","dark":"#191A19"}},"navbar":{"primary":{"type":"button","label":"Dashboard","href":"https://app.nanocorp.so"}},"footer":{"socials":{"x":"https://x.com/NanoCorpHQ","discord":"https://discord.gg/cQPWu8WCDG"},"links":[{"header":"NanoCorp","items":[{"label":"Website","href":"https://www.nanocorp.so"},{"label":"Pricing","href":"https://www.nanocorp.so/pricing"},{"label":"Open the app","href":"https://app.nanocorp.so"}]},{"header":"Legal","items":[{"label":"Terms","href":"https://www.nanocorp.so/terms"},{"label":"Privacy","href":"https://www.nanocorp.so/privacy"},{"label":"Refunds","href":"https://www.nanocorp.so/refund"}]}]},"fonts":{"heading":{"family":"Instrument Serif","weight":400},"body":{"family":"IBM Plex Sans","weight":400}},"integrations":{"posthog":{"apiKey":"phc_JDwhGvB7nRcIu4nXoO6gDtUs9GawrurMP2yGhTbVpg7","apiHost":"https://us.i.posthog.com"}},"errors":{"404":{"redirect":false,"title":"Page not found","description":"The page you requested could not be found. Try the [documentation home](/) or [llms.txt](/llms.txt)."}},"markdown":{"instructions":["NanoCorp's MCP server, the one that acts on a NanoCorp account, is https://mcp.nanocorp.so (OAuth sign-in).","This documentation site's /mcp endpoint and its /.well-known/mcp files are a documentation search server, not NanoCorp.","To connect an AI agent to NanoCorp, follow https://docs.nanocorp.so/agents."]},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"nanocorp","hasAudioNarration":false,"actualSubdomain":"nanocorp","customDomains":["docs.nanocorp.so"],"gitSource":{"type":"github","owner":"phospho-app","repo":"nanocorp","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adc8714504201768b1c7619","collectionId":"e3ef1c32-e775-4674-a403-31cff70b7220","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adc8714504201768b1c7619"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6adc8714504201768b1c7619","clientVersion":"0.0.3969","searchFilterCounts":[{"language":"default","tag":"AI agents","count":24},{"language":"default","tag":"Overview","count":20},{"language":"default","tag":"Your business","count":8},{"language":"default","tag":"MCP reference","count":4},{"language":"default","tag":"Selling","count":4},{"language":"default","tag":"Web app","count":3},{"language":"default","tag":"Growth","count":2},{"language":"default","tag":"Run your business","count":2},{"language":"default","tag":"Plans and billing","count":2},{"language":"default","tag":"Help","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"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":"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}],"isAtlas":false,"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"user-auth","slug":"/user-auth","pageMetadata":{"title":"Sign in with NanoCorp","description":"Give your business's app real user accounts: your visitors sign in with a NanoCorp account, and your app receives their name, email, and picture, with no password handling, no auth service to wire.","keywords":["auth","authentication","login","sign in","user accounts","oidc","sso","@nanocorp/auth","NANOCORP_AUTH_CLIENT_ID","requireOwner","test mode"],"href":"/user-auth"},"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: \"Give your business’s app real user accounts: your visitors sign in with a NanoCorp account, and your app receives their name, email, and picture, with no password handling, no auth service to wire.\"\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`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Apps built on NanoCorp can offer `,_jsx(_components.strong,{children:`Sign in with NanoCorp`}),`: visitors sign in\nwith a NanoCorp account (creating one takes seconds), and your app receives\ntheir identity: name, email address, profile picture, and whether they own\nthis business. One NanoCorp account works across every NanoCorp-built app.`]}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`Ask your agent to “enable user auth and add sign-in to the site”. It will\nenable the feature, install the SDK, and wire the pages. This page explains\nwhat happens underneath and what you can rely on.`})}),`\n`,_jsx(Heading,{level:`2`,id:`how-it-works`,children:`How it works`}),`\n`,_jsxs(_components.p,{children:[`NanoCorp runs the identity service (an OpenID Connect provider at\n`,_jsx(_components.code,{children:`accounts.nanocorp.so`}),`). Your app uses the open-source\n`,_jsx(_components.a,{href:`https://www.npmjs.com/package/@nanocorp/auth`,children:_jsx(_components.code,{children:`@nanocorp/auth`})}),` package, which\nhandles the whole flow: the sign-in redirect, the callback, a secure session\ncookie on your app’s own domain (7 days), and sign-out.`]}),`\n`,_jsxs(_components.p,{children:[`Enabling the feature needs a deployed website. It provisions your app’s credentials and sets six managed\nenvironment variables on your deployment (`,_jsx(_components.code,{children:`NANOCORP_AUTH_CLIENT_ID`}),`,\n`,_jsx(_components.code,{children:`NANOCORP_AUTH_CLIENT_SECRET`}),`, `,_jsx(_components.code,{children:`NANOCORP_AUTH_SESSION_SECRET`}),`,\n`,_jsx(_components.code,{children:`NANOCORP_AUTH_SESSION_SECRET_PREVIOUS`}),`, `,_jsx(_components.code,{children:`NANOCORP_AUTH_ISSUER`}),`,\n`,_jsx(_components.code,{children:`NANOCORP_AUTH_BASE_URL`}),`). They are platform-managed: agents cannot overwrite\nthem, and secret values are never displayed.`]}),`\n`,_jsx(Heading,{level:`2`,id:`what-your-app-receives`,children:`What your app receives`}),`\n`,_jsxs(_components.p,{children:[`When someone signs in and consents, your app gets: their NanoCorp user id\n(stable), name, email address, profile picture, and an `,_jsx(_components.code,{children:`is_app_owner`}),` flag.\nThe consent screen tells them exactly that, and that NanoCorp businesses are\nbuilt and run with AI agents.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Signed-in users are `,_jsx(_components.strong,{children:`sign-in identities, not a marketing list`}),`. You are\nresponsible for the personal data your app receives; use it to operate your\nproduct, not for unsolicited outreach (see the Terms of Service).`]})}),`\n`,_jsx(Heading,{level:`2`,id:`seeing-your-users`,children:`Seeing your users`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.strong,{children:`Users`}),` section in `,_jsx(_components.strong,{children:`Business settings`}),` lists everyone who signed in to\nyour app, with their last sign-in date. Before the feature is on, it reads “Not\non” and suggests asking your agent to add sign-in. Your agent can read the same\nlist with the `,_jsx(_components.code,{children:`list_app_users`}),` tool, or `,_jsx(_components.code,{children:`nanocorp auth users`}),` in its terminal.`]}),`\n`,_jsx(Heading,{level:`2`,id:`owner-only-areas`,children:`Owner-only areas`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`is_app_owner`}),` flag is true only for you (the owner of this business), so\nyour app can ship an admin area. Rendering can trust the flag; anything that\n`,_jsx(_components.em,{children:`changes`}),` data goes through the SDK’s `,_jsx(_components.code,{children:`requireOwner()`}),`, which re-checks\nownership live with the platform on every call.`]}),`\n`,_jsx(Heading,{level:`2`,id:`paid-members`,children:`Paid members`}),`\n`,_jsxs(_components.p,{children:[`If you sell a `,_jsx(_components.a,{href:`/subscriptions`,children:`monthly plan`}),`, Sign in with NanoCorp is what\nturns it into a members-only area. Your agent wires these calls from the\n`,_jsx(_components.code,{children:`@nanocorp/auth`}),` package, and each one has one job:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,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:`6`,children:[_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:` user`}),_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:` getUser`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// is the visitor signed in?`})]}),`\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:` subs`}),_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:` getSubscriptions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`user`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// do they already pay?`})]}),`\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:` href`}),_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:` subscribeUrl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`productId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// the Subscribe button`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` requireSubscriber`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`productId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// guard every paid page`})]}),`\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:` manage`}),_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:` billingPortalUrl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`returnTo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// the \"Cancel plan\" button`})]}),`\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:` card`}),_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:` billingPortalUrl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`returnTo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`flow:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"update_card\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`requireSubscriber()`}),` asks the platform live and fails closed, so it is what\nprotects the paid pages. `,_jsx(_components.code,{children:`subscribeUrl()`}),` is computed for the signed-in\nvisitor at render time, which is why a plan has no copyable buy link. If the\nplan cannot be checked right now, the button still works: it starts the\nsubscription when pressed. The billing link opens the cancel flow by default,\nso pass `,_jsx(_components.code,{children:`update_card`}),` for the button that changes the card. Right after a\npayment a members page can still read “not subscribed” for up to two minutes,\nso the success page never gates itself.`]}),`\n`,_jsx(_components.p,{children:`A subscriber is a paying customer of your business, so writing to them about\ntheir plan is fine. The rule above still holds for everyone who only signed in.`}),`\n`,_jsx(Heading,{level:`2`,id:`domains-and-sessions`,children:`Domains and sessions`}),`\n`,_jsx(_components.p,{children:`The session cookie is bound to your app’s domain. If you attach or change a\ncustom domain, existing app users are signed out at the next deploy and simply\nsign in again. Nothing is lost.`}),`\n`,_jsx(Heading,{level:`2`,id:`if-your-app’s-environment-leaks`,children:`If your app’s environment leaks`}),`\n`,_jsx(_components.p,{children:`Resetting your app’s sign-in secrets is a recovery step reserved for you, the\nbusiness owner. Your agent cannot run it, in any mode, and you should never\nhand it your own login or token so that it can.`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Install the `,_jsx(_components.a,{href:`/cli`,children:`NanoCorp CLI`}),` on your own computer and sign in with\n`,_jsx(_components.code,{children:`nanocorp login`}),`.`]}),`\n`,_jsx(_components.li,{children:`Reset the secrets for your business and sign everyone out:`}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,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:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`nanocorp`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` auth`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` rotate-secret`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --company`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`your-business-handl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`e`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --revoke-sessions`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Every signed-in user is signed out once the site redeploys, and simply signs\nin again. That is the right call after a leak: a session created with the old\nsecrets must stop working. For a precautionary reset when nothing leaked, leave\nout `,_jsx(_components.code,{children:`--revoke-sessions`}),`: existing sessions keep working, so your users notice\nnothing. Either way, when the previous key cannot be recovered everyone is\nsigned out, and the reset tells you so.`]}),`\n`,_jsxs(_components.p,{children:[`The reset only works with your own login. If it answers “Only the business\nowner can reset app sign-in”, the terminal is using a business credential\ninstead of yours: run it from your own terminal and make sure `,_jsx(_components.code,{children:`NANOCORP_TOKEN`}),`\nis not set there.`]}),`\n`,_jsxs(_components.p,{children:[`Need a hand? Write to `,_jsx(_components.a,{href:`mailto:support@nanocorp.so`,children:`support@nanocorp.so`}),` from\nyour account email and we will walk you through it.`]}),`\n`,_jsx(Heading,{level:`2`,id:`deleting-an-end-user-account`,children:`Deleting an end-user account`}),`\n`,_jsxs(_components.p,{children:[`End-users of NanoCorp-built apps can ask us to delete their NanoCorp account\nat `,_jsx(_components.a,{href:`mailto:support@nanocorp.so`,children:`support@nanocorp.so`}),`.`]}),`\n`,_jsx(_components.p,{children:`An account that still holds an active plan cannot be deleted: cancel the plan\nfirst, then ask for the deletion.`})]})}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":"Sign in with NanoCorp","description":"Give your business's app real user accounts: your visitors sign in with a NanoCorp account, and your app receives their name, email, and picture, with no password handling, no auth service to wire.","keywords":["auth","authentication","login","sign in","user accounts","oidc","sso","@nanocorp/auth","NANOCORP_AUTH_CLIENT_ID","requireOwner","test mode"],"href":"/user-auth"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"How it works","slug":"how-it-works","depth":2,"children":[]},{"title":"What your app receives","slug":"what-your-app-receives","depth":2,"children":[]},{"title":"Seeing your users","slug":"seeing-your-users","depth":2,"children":[]},{"title":"Owner-only areas","slug":"owner-only-areas","depth":2,"children":[]},{"title":"Paid members","slug":"paid-members","depth":2,"children":[]},{"title":"Domains and sessions","slug":"domains-and-sessions","depth":2,"children":[]},{"title":"If your app’s environment leaks","slug":"if-your-app’s-environment-leaks","depth":2,"children":[]},{"title":"Deleting an end-user account","slug":"deleting-an-end-user-account","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"nanocorp","siteName":"NanoCorp","title":"Sign in with NanoCorp - NanoCorp","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-06T01:59:41.415Z","originalFileLocation":"user-auth.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=\"Give your business\u0026#x27;s app real user accounts: your visitors sign in with a NanoCorp account, and your app receives their name, email, and picture, with no password handling, no auth service to wire.\">\u003cmeta data-mint-head name=\"application-name\" content=\"NanoCorp\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/nanocorp/7IqA5VIN_XvuPIzf/_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=\"/mintlify-assets/_mintlify/favicons/nanocorp/7IqA5VIN_XvuPIzf/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/nanocorp/7IqA5VIN_XvuPIzf/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/nanocorp/7IqA5VIN_XvuPIzf/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/nanocorp/7IqA5VIN_XvuPIzf/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/nanocorp/7IqA5VIN_XvuPIzf/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/nanocorp/7IqA5VIN_XvuPIzf/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/nanocorp/7IqA5VIN_XvuPIzf/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/nanocorp/7IqA5VIN_XvuPIzf/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Sign in with NanoCorp - NanoCorp\">\u003cmeta data-mint-head property=\"og:description\" content=\"Give your business\u0026#x27;s app real user accounts: your visitors sign in with a NanoCorp account, and your app receives their name, email, and picture, with no password handling, no auth service to wire.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"NanoCorp\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.nanocorp.so/user-auth\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://nanocorp.mintlify.app/_mintlify/api/og/v2?division=Your+business\u0026amp;title=Sign+in+with+NanoCorp\u0026amp;description=Give+your+business%27s+app+real+user+accounts%3A+your+visitors+sign+in+with+a+NanoCorp+account%2C+and+your+app+receives+their+name%2C+email%2C+and+picture%2C+with+no+passwo\u0026amp;theme=b97b0d77ccef610777feec25\u0026amp;signature=c53b71d7a03e3bb72066e4f8ef7c779a96df5c463919f4b0555a76e1ddf84450\">\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=\"Sign in with NanoCorp - NanoCorp\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Give your business\u0026#x27;s app real user accounts: your visitors sign in with a NanoCorp account, and your app receives their name, email, and picture, with no password handling, no auth service to wire.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://nanocorp.mintlify.app/_mintlify/api/og/v2?division=Your+business\u0026amp;title=Sign+in+with+NanoCorp\u0026amp;description=Give+your+business%27s+app+real+user+accounts%3A+your+visitors+sign+in+with+a+NanoCorp+account%2C+and+your+app+receives+their+name%2C+email%2C+and+picture%2C+with+no+passwo\u0026amp;theme=b97b0d77ccef610777feec25\u0026amp;signature=c53b71d7a03e3bb72066e4f8ef7c779a96df5c463919f4b0555a76e1ddf84450\">\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=\"/mintlify-assets/_mintlify/favicons/nanocorp/7IqA5VIN_XvuPIzf/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"NanoCorp\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#4E9E94\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.nanocorp.so/user-auth\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/user-auth.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.nanocorp.so/#organization\",\"name\":\"NanoCorp\",\"url\":\"https://docs.nanocorp.so\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/nanocorp/dZqX8HJ9SmgTqTHV/logo/light.svg?fit=max\u0026auto=format\u0026n=dZqX8HJ9SmgTqTHV\u0026q=85\u0026s=aed39ea9c96046d224dcf9f9fd48343f\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.nanocorp.so#website\",\"name\":\"NanoCorp\",\"url\":\"https://docs.nanocorp.so\",\"publisher\":{\"@id\":\"https://docs.nanocorp.so/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.nanocorp.so/user-auth#webpage\",\"url\":\"https://docs.nanocorp.so/user-auth\",\"name\":\"Sign in with NanoCorp\",\"description\":\"Give your business's app real user accounts: your visitors sign in with a NanoCorp account, and your app receives their name, email, and picture, with no password handling, no auth service to wire.\",\"dateModified\":\"2026-10-06T01:59:41.415Z\",\"isPartOf\":{\"@id\":\"https://docs.nanocorp.so#website\"},\"breadcrumb\":{\"@id\":\"https://docs.nanocorp.so/user-auth#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.nanocorp.so/user-auth#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Your business\",\"item\":\"https://docs.nanocorp.so/custom-domains\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Sign in with NanoCorp\",\"item\":\"https://docs.nanocorp.so/user-auth\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.nanocorp.so/user-auth#article\",\"headline\":\"Sign in with NanoCorp\",\"name\":\"Sign in with NanoCorp\",\"description\":\"Give your business's app real user accounts: your visitors sign in with a NanoCorp account, and your app receives their name, email, and picture, with no password handling, no auth service to wire.\",\"url\":\"https://docs.nanocorp.so/user-auth\",\"mainEntityOfPage\":{\"@id\":\"https://docs.nanocorp.so/user-auth#webpage\"},\"dateModified\":\"2026-10-06T01:59:41.415Z\",\"keywords\":\"auth, authentication, login, sign in, user accounts, oidc, sso, @nanocorp/auth, NANOCORP_AUTH_CLIENT_ID, requireOwner, test mode\",\"publisher\":{\"@id\":\"https://docs.nanocorp.so/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.nanocorp.so#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"NanoCorp\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"NanoCorp","nav":{"global":null,"tabs":[{"tab":"Overview","icon":"book-open","groups":[{"group":"Get started","pages":[{"title":"Create and run autonomous businesses with AI agents","sidebarTitle":"Welcome","href":""},{"title":"How NanoCorp works","href":"/how-it-works"}]},{"group":"Plans and billing","pages":[{"title":"NanoCorp pricing: plans and credits","sidebarTitle":"Plans and credits","href":"/plans-and-credits"},{"title":"Billing, refunds and cancellations","href":"/billing-policy"}]},{"group":"Selling","pages":[{"title":"Checkout link parameters","href":"/checkout-links"},{"title":"Testing your checkout","href":"/testing-payments"},{"title":"Monthly plans","href":"/subscriptions"},{"title":"Withdrawals","href":"/withdrawals"}]},{"group":"Your business","pages":[{"title":"Use a custom domain","href":"/custom-domains"},{"title":"Access the code on GitHub","href":"/github-access"},{"title":"Add secrets to your business","href":"/secrets"},{"title":"Upload files to your business","description":"Share brand assets, PDFs, CSVs and folders with your business's agent, and find the files it makes there too.","href":"/file-uploads"},{"title":"Sign in with NanoCorp","href":"/user-auth"},{"title":"Business API key","description":"Every business has one permanent API key its website and agents use to call the NanoCorp platform: find it, use it server-side, and rotate it if it leaks.","href":"/company-api-key"},{"title":"Connections","href":"/connections"},{"title":"Tool rate limits","href":"/rate-limits"}]},{"group":"Growth","pages":[{"title":"Advertising","href":"/advertising"},{"title":"Launch kit","href":"/launch-kit"}]},{"group":"Help","pages":[{"title":"NanoCorp FAQ","sidebarTitle":"FAQ","href":"/faq"},{"title":"Support","href":"/support"}]}]},{"tab":"Web app","icon":"globe","pages":[{"title":"Web app","href":"/founding-interview"}]},{"tab":"AI agents","icon":"robot","pages":[{"title":"AI agents","href":"/agents"}]}]},"title":"Sign in with NanoCorp - NanoCorp","buildId":"dpl_G8u2B2Ji9qJYF9umedjv293TxycS","deploymentId":"dpl_G8u2B2Ji9qJYF9umedjv293TxycS","dynamics":[],"chunks":[]}