The User model in Nile Auth defines the structure of a user object. It includes both basic and custom properties to meet the needs of your application.
When a user is created, they are not automatically added to a tenant, unless newTenant is present. Users can only add other users to tenants of which they are a member. To add a user to a tenant, use linkUser
const user1 = await nile.users.createUser({ email: 'user1@example.com', password: 'user1', newTenant: 'myTenant',});const user2 = await nile.users.createUser({ email: 'user2@example.com', password: 'user2',});// make user1 and user2 part of the same tenantconst updated2 = await nile.tenants.addMember(user2.id);
Because users are isolated to their own session, existing user update themselves via PUT method. A custom endpoint would need to be created in order for one user to update the information of another.
Because user accounts are isolated, one user is unable to delete another. It is possible remove a user from a tenant from the built-in API. In order to to that, use unlinkUser
Password-based authentication is not recommended for production applications.
Use social authentication or other secure methods instead.
You can authenticate users using their email and password. After a successful login, a session token in for form of a JWT is returned. All other forms use a session token saved in the database.
For demonstration purposes, we are using the server-side methods. It would be rare to do this in a real application.
// Example password authentication - not recommended for productionconst session = await nile.auth.login({ email: 'user@example.com', password: 'password123',});
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Nile Documentation","colors":{"primary":"#fdb768","light":"#fdb768","dark":"#fdb768"},"logo":{"light":"https://mintcdn.com/nile/SZ6JYQiPYP1_QgSP/images/nilemintlogo.svg?fit=max\u0026auto=format\u0026n=SZ6JYQiPYP1_QgSP\u0026q=85\u0026s=3303eacc9118937fc5b967ee98a24024","dark":"https://mintcdn.com/nile/SZ6JYQiPYP1_QgSP/images/nilemintlogo.svg?fit=max\u0026auto=format\u0026n=SZ6JYQiPYP1_QgSP\u0026q=85\u0026s=3303eacc9118937fc5b967ee98a24024","href":"https://www.thenile.dev"},"favicon":"https://mintcdn.com/nile/CzaL00MoWjPpKNw_/images/favicon.svg?fit=max\u0026auto=format\u0026n=CzaL00MoWjPpKNw_\u0026q=85\u0026s=5c01c6ff6f635b2a4799d56abab1a71a","appearance":{"default":"dark","strict":true},"navbar":{"links":[{"href":"https://discord.com/invite/8UuBB84tTy","label":"Community"}],"primary":{"type":"button","label":"Get Started","href":"https://console.thenile.dev"}},"footer":{"socials":{"x":"https://x.com/niledatabase","github":"https://github.com/niledatabase/niledatabase","linkedin":"https://www.linkedin.com/company/niledatabase","discord":"https://discord.com/invite/8UuBB84tTy"},"links":[{"header":"Resources","items":[{"label":"Blog","href":"https://www.thenile.dev/blog"},{"label":"Pricing","href":"https://www.thenile.dev/pricing"},{"label":"Templates","href":"https://www.thenile.dev/templates"},{"label":"Community","href":"https://www.thenile.dev/community"}]},{"header":"Company","items":[{"label":"Careers","href":"https://www.thenile.dev/about-us"},{"label":"About","href":"https://www.thenile.dev/about-us"}]},{"header":"Support","items":[{"label":"Contact Sales","href":"https://www.thenile.dev/contact-us"},{"label":"Get Help","href":"https://www.thenile.dev/contact-us"},{"label":"FAQ","href":"https://www.thenile.dev/pricing"}]}]},"seo":{"metatags":{"og:image":"https://www.thenile.dev/opengraph/docs.jpg"},"indexing":"navigable"},"integrations":{"ga4":{"measurementId":"G-KE7812B4ZF"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"nile","hasAudioNarration":false,"actualSubdomain":"nile","customDomains":["thenile.dev"],"gitSource":{"type":"github","owner":"niledatabase","repo":"niledatabase","deployBranch":"main","contentDirectory":"www/app/docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a9cbf6e7168debd2fad7286","collectionId":"92cf1a7a-4366-49ff-a155-84808e6665bd","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6a9cbf6e7168debd2fad7286"},"feedback":{"thumbs":true,"issues":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6a9cbf6e7168debd2fad7286","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"default","tag":"Postgres","count":93},{"language":"default","tag":"Auth","count":68},{"language":"default","tag":"Nile Auth","count":61},{"language":"default","tag":"ManagementAPI","count":40},{"language":"default","tag":"Extensions","count":37},{"language":"default","tag":"Get Started","count":37},{"language":"default","tag":"Auth API","count":33},{"language":"default","tag":"Platform","count":24},{"language":"default","tag":"databases","count":20},{"language":"default","tag":"Usecases","count":18}]},"assistantConfig":{},"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":false},"customCss":[],"page":{"pagePath":"auth/concepts/users","slug":"/auth/concepts/users","pageMetadata":{"title":"Users","description":"Understanding user management in Nile Auth","href":"/auth/concepts/users"},"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: \"Understanding user management in Nile Auth\"\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`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Learn about user management concepts in Nile Auth, including how to create, update, and manage users and their sessions.`}),`\n`,_jsx(Heading,{level:`2`,id:`user-model`,children:`User Model`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`User`}),` model in Nile Auth defines the structure of a user object. It includes both basic and custom properties to meet the needs of your application.`]}),`\n`,_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\":`#569CD6`},children:`interface`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` User`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` email`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` familyName`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` givenName`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` picture`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` created`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` updated`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` emailVerified`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` tenants`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_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`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`user-properties`,children:`User Properties`}),`\n`,_jsx(Heading,{level:`3`,id:`basic-properties`,children:`Basic Properties`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Email`}),`: The user’s email address. This is true across all users of a database`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Profile information`}),`: Includes details like the user’s name, contact info, and other relevant data, along with any tenants the user is associated.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`user-operations`,children:`User Operations`}),`\n`,_jsx(Heading,{level:`3`,id:`creating-users`,children:`Creating Users`}),`\n`,_jsxs(_components.p,{children:[`To create a new user, you can make a POST request to the `,_jsx(_components.code,{children:`/users`}),` endpoint.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,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:`4`,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:` newUser`}),_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:` nile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`users`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`createUser`}),_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:` email:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user@example.com'`}),_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:` password:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user1'`}),_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`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`adding-users`,children:`Adding users`}),`\n`,_jsxs(_components.p,{children:[`When a user is created, they are not automatically added to a tenant, unless `,_jsx(_components.code,{children:`newTenant`}),` is present. Users can only add other users to tenants of which they are a member. To add a user to a tenant, use `,_jsx(_components.code,{children:`linkUser`})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,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:`11`,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:` user1`}),_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:` nile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`users`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`createUser`}),_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:` email:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user1@example.com'`}),_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:` password:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user1'`}),_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:` newTenant:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'myTenant'`}),_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.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:` user2`}),_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:` nile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`users`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`createUser`}),_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:` email:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user2@example.com'`}),_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:` password:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user2'`}),_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:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// make user1 and user2 part of the same tenant`})}),`\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:` updated2`}),_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:` nile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`tenants`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`addMember`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`user2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`updating-users`,children:`Updating Users`}),`\n`,_jsxs(_components.p,{children:[`Because users are isolated to their own session, existing user update themselves via `,_jsx(_components.code,{children:`PUT`}),` method. A custom endpoint would need to be created in order for one user to update the information of another.`]}),`\n`,_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\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` updatedUser`}),_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:` nile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`users`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`updateSelf`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`name:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user1'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`deleting-users`,children:`Deleting Users`}),`\n`,_jsxs(_components.p,{children:[`Because user accounts are isolated, one user is unable to delete another. It is possible remove a user from a tenant from the built-in API. In order to to that, use `,_jsx(_components.code,{children:`unlinkUser`})]}),`\n`,_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\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` unlinked`}),_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:` nile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`tenants`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`removeMember`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`user2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`user-authentication`,children:`User Authentication`}),`\n`,_jsx(Heading,{level:`3`,id:`password-based-authentication`,children:`Password-based Authentication`}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Password-based authentication is not recommended for production applications.\nUse social authentication or other secure methods instead.`})}),`\n`,_jsx(_components.p,{children:`You can authenticate users using their email and password. After a successful login, a session token in for form of a JWT is returned. All other forms use a session token saved in the database.\nFor demonstration purposes, we are using the server-side methods. It would be rare to do this in a real application.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,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:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Example password authentication - not recommended for production`})}),`\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:` session`}),_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:` nile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`login`}),_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:` email:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user@example.com'`}),_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:` password:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'password123'`}),_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`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`social-authentication`,children:`Social Authentication`}),`\n`,_jsxs(_components.p,{children:[`Nile Auth also supports social authentication via OAuth providers such as Google or Facebook. In order to configure this, see `,_jsx(_components.a,{href:`/auth/singlesignon/google`,children:`Single Sign On`})]}),`\n`,_jsx(Heading,{level:`2`,id:`user-sessions`,children:`User Sessions`}),`\n`,_jsx(_components.p,{children:`A session is always within the context of a request. You can access session data using:`}),`\n`,_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\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` session`}),_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:` nile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`related-topics`,children:`Related Topics`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/auth/concepts/sessions`,children:`Sessions`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/auth/concepts/tenants`,children:`Tenants`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/auth/concepts/jwt`,children:`JWT`})}),`\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":"Users","description":"Understanding user management in Nile Auth","href":"/auth/concepts/users"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"User Model","slug":"user-model","depth":2,"children":[]},{"title":"User Properties","slug":"user-properties","depth":2,"children":[{"title":"Basic Properties","slug":"basic-properties","depth":3,"children":[]}]},{"title":"User Operations","slug":"user-operations","depth":2,"children":[{"title":"Creating Users","slug":"creating-users","depth":3,"children":[]},{"title":"Adding users","slug":"adding-users","depth":3,"children":[]},{"title":"Updating Users","slug":"updating-users","depth":3,"children":[]},{"title":"Deleting Users","slug":"deleting-users","depth":3,"children":[]}]},{"title":"User Authentication","slug":"user-authentication","depth":2,"children":[{"title":"Password-based Authentication","slug":"password-based-authentication","depth":3,"children":[]},{"title":"Social Authentication","slug":"social-authentication","depth":3,"children":[]}]},{"title":"User Sessions","slug":"user-sessions","depth":2,"children":[]},{"title":"Related Topics","slug":"related-topics","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"nile","siteName":"Nile Documentation","title":"Users - Nile Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2025-12-08T20:52:59.481Z","originalFileLocation":"auth/concepts/users.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"dark\";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=\"dark\"}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=\"Understanding user management in Nile Auth\">\u003cmeta data-mint-head name=\"application-name\" content=\"Nile Documentation\">\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/nile/GO7FOq6RcmxStYK0/_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/nile/GO7FOq6RcmxStYK0/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/nile/GO7FOq6RcmxStYK0/_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/nile/GO7FOq6RcmxStYK0/_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/nile/GO7FOq6RcmxStYK0/_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/nile/GO7FOq6RcmxStYK0/_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/nile/GO7FOq6RcmxStYK0/_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/nile/GO7FOq6RcmxStYK0/_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/nile/GO7FOq6RcmxStYK0/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Users - Nile Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Understanding user management in Nile Auth\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Nile Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://thenile.dev/docs/auth/concepts/users\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://www.thenile.dev/opengraph/docs.jpg\">\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=\"Users - Nile Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Understanding user management in Nile Auth\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://www.thenile.dev/opengraph/docs.jpg\">\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/nile/GO7FOq6RcmxStYK0/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Nile Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#fdb768\">\u003clink data-mint-head rel=\"canonical\" href=\"https://thenile.dev/docs/auth/concepts/users\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/auth/concepts/users.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://thenile.dev/#organization\",\"name\":\"Nile Documentation\",\"url\":\"https://thenile.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/nile/SZ6JYQiPYP1_QgSP/images/nilemintlogo.svg?fit=max\u0026auto=format\u0026n=SZ6JYQiPYP1_QgSP\u0026q=85\u0026s=3303eacc9118937fc5b967ee98a24024\"}},{\"@type\":\"WebSite\",\"@id\":\"https://thenile.dev/docs#website\",\"name\":\"Nile Documentation\",\"url\":\"https://thenile.dev/docs\",\"publisher\":{\"@id\":\"https://thenile.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://thenile.dev/docs/auth/concepts/users#webpage\",\"url\":\"https://thenile.dev/docs/auth/concepts/users\",\"name\":\"Users\",\"description\":\"Understanding user management in Nile Auth\",\"dateModified\":\"2025-12-08T20:52:59.481Z\",\"isPartOf\":{\"@id\":\"https://thenile.dev/docs#website\"},\"breadcrumb\":{\"@id\":\"https://thenile.dev/docs/auth/concepts/users#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://thenile.dev/docs/auth/concepts/users#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Nile Auth\",\"item\":\"https://thenile.dev/docs/auth/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Concepts\",\"item\":\"https://thenile.dev/docs/auth/concepts/tenants\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Users\",\"item\":\"https://thenile.dev/docs/auth/concepts/users\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://thenile.dev/docs/auth/concepts/users#article\",\"headline\":\"Users\",\"name\":\"Users\",\"description\":\"Understanding user management in Nile Auth\",\"url\":\"https://thenile.dev/docs/auth/concepts/users\",\"mainEntityOfPage\":{\"@id\":\"https://thenile.dev/docs/auth/concepts/users#webpage\"},\"image\":\"https://www.thenile.dev/opengraph/docs.jpg\",\"dateModified\":\"2025-12-08T20:52:59.481Z\",\"publisher\":{\"@id\":\"https://thenile.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://thenile.dev/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Nile Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Nile Documentation","nav":{"global":null,"tabs":[{"tab":"Postgres","pages":[{"title":"Postgres","href":"/getting-started/getting-started"}]},{"tab":"Auth","pages":[{"group":"Nile Auth","pages":[{"title":"Introduction","icon":"user","href":"/auth/introduction"},{"title":"Comparison","icon":"code-compare","href":"/auth/comparison"},{"title":"Installation","icon":"play","href":"/auth/getting-started/installation"},{"group":"Quickstart","icon":"rocket","pages":[{"title":"NextJs","icon":"square-arrow-up-right","href":"/auth/quickstarts/nextjs"},{"title":"Remix","icon":"shuffle","href":"/auth/quickstarts/remix"},{"title":"Express.js","icon":"server","href":"/auth/quickstarts/express"}]},{"title":"Self Host Nile Auth","icon":"server","href":"/auth/selfhosting"},{"title":"Examples","icon":"lightbulb","href":"/auth/examples"},{"group":"Concepts","icon":"folder","pages":[{"title":"Tenants","description":"Learn about tenant management in Nile Auth","href":"/auth/concepts/tenants"},{"title":"Users","href":"/auth/concepts/users"},{"title":"Sessions","description":"Understanding session management in Nile Auth","href":"/auth/concepts/sessions"},{"title":"JWTs","href":"/auth/concepts/jwt"},{"title":"Cookies","href":"/auth/concepts/cookies"},{"title":"OAuth","href":"/auth/concepts/oauth"},{"title":"Built-in Tables","href":"/auth/concepts/builtintables"},{"title":"Per-Tenant Overrides","href":"/auth/concepts/per-tenantoverrides"},{"title":"Account Linking","href":"/auth/concepts/acclinking"},{"title":"Extensions","href":"/auth/concepts/extensions"},{"title":"Multi-factor Authentication (MFA) Concepts","href":"/auth/concepts/multifactor"}]},{"group":"Email","icon":"envelope","pages":[{"title":"Passwords","href":"/auth/email/password"},{"title":"Templates","href":"/auth/email/templates"},{"title":null,"href":"/auth/email/verification"},{"title":"Custom SMTP","href":"/auth/email/customsmtp"},{"title":null,"href":"/auth/email/invites"}]},{"group":"Single Sign On","icon":"right-to-bracket","pages":[{"title":"Google","icon":"google","href":"/auth/singlesignon/google"},{"title":"GitHub","icon":"github","href":"/auth/singlesignon/github"},{"title":"Discord","icon":"discord","href":"/auth/singlesignon/discord"},{"title":"LinkedIn","icon":"linkedin","href":"/auth/singlesignon/linkedin"},{"title":"Microsoft Azure","icon":"microsoft","href":"/auth/singlesignon/microsoft"},{"title":"HubSpot","icon":"hubspot","href":"/auth/singlesignon/hubspot"},{"title":"X (Twitter)","icon":"x-twitter","href":"/auth/singlesignon/x"},{"title":"Slack","icon":"slack","href":"/auth/singlesignon/slack"}]},{"title":"Magic Link","icon":"wand-magic-sparkles","href":"/auth/magiclink"},{"group":"Components","icon":"browser","pages":[{"title":"Sign In","href":"/auth/components/signin"},{"title":"Sign Up","href":"/auth/components/signup"},{"title":"Sign Out","href":"/auth/components/signout"},{"title":"Users","href":"/auth/components/user"},{"title":"Organization","href":"/auth/components/organization"},{"title":"Customize","href":"/auth/components/customization"},{"title":"Multi-factor","href":"/auth/components/multifactor"}]},{"group":"Dashboard","icon":"table-columns","pages":[{"title":"Managing Tenants","href":"/auth/dashboard/managing-tenants"},{"title":"Managing Users","href":"/auth/dashboard/managing-users"},{"title":"Configurations","href":"/auth/dashboard/configurations"}]},{"group":"Migration","icon":"truck-moving","pages":[{"title":"From NextAuth.js","href":"/auth/migration/fromnextauth"},{"title":"From Firebase","href":"/auth/migration/fromfirebase"},{"title":"From Auth0","href":"/auth/migration/fromauth0"}]},{"group":"SDK Reference","icon":"code","pages":[{"group":"JavaScript (server)","icon":"js","pages":[{"title":"Overview","href":"/auth/sdk-reference/javascript/overview"},{"title":"Auth","href":"/auth/sdk-reference/javascript/server/auth"},{"title":"Users","href":"/auth/sdk-reference/javascript/server/users"},{"title":"Tenants","href":"/auth/sdk-reference/javascript/server/tenants"},{"title":"DB","href":"/auth/sdk-reference/javascript/server/db"},{"title":"Routes","href":"/auth/sdk-reference/javascript/server/routes"},{"title":"Configuration","href":"/auth/sdk-reference/javascript/server/configuration"}]},{"title":"JavaScript (client)","icon":"js","href":"/auth/sdk-reference/javascript/client/authorizer"}]},{"group":"Help","icon":"question","pages":[{"title":"Errors","href":"/auth/help/errors"},{"title":"FAQ","href":"/auth/help/faq"},{"title":"Community","href":"/auth/help/community"}]},{"group":"Contributing","icon":"hand-holding-hand","pages":[{"title":"Development","href":"/auth/contributing/develop"},{"title":"Testing","href":"/auth/contributing/testing"},{"title":"Issues","href":"/auth/contributing/report"}]},{"title":"Roadmap","icon":"road","url":"https://github.com/orgs/niledatabase/discussions?discussions_q=label%3Aauth","href":"/auth/roadmap"}]},{"group":"Frameworks","icon":"puzzle-piece","pages":[{"title":"Express","icon":"server","href":"/auth/frameworks/express"},{"title":"Next.js","icon":"n","href":"/auth/frameworks/nextjs"},{"title":"Nitro","icon":"bolt-lightning","href":"/auth/frameworks/nitro"},{"title":"Nuxt","icon":"mountain","href":"/auth/frameworks/nuxt"},{"title":"React","icon":"atom","href":"/auth/frameworks/react"},{"title":"Remix","icon":"route","href":"/auth/frameworks/remix"},{"title":"Elysia","icon":"firefox-browser","href":"/auth/frameworks/elysia"}]}]},{"tab":"AI","pages":[{"title":"AI","href":"/ai-embeddings/introduction"}]},{"tab":"Platform","pages":[{"title":"Platform","href":"/cli/introduction"}]},{"tab":"ManagementAPI","pages":[{"title":"ManagementAPI","href":"/api-reference/databases/list-dedicated-compute-instances-for-a-database"}]},{"tab":"Auth API","pages":[{"title":"Auth API","href":"/auth/api-reference/auth/sign-in-to-the-application"}]},{"tab":"Pricing","href":"https://www.thenile.dev/pricing"},{"tab":"Templates","href":"https://www.thenile.dev/templates"},{"tab":"Discord","href":"https://discord.com/invite/8UuBB84tTy"}]},"title":"Users - Nile Documentation","buildId":"dpl_AUojGTPodKNPTVaxVPcxnNvkSVqo","deploymentId":"dpl_AUojGTPodKNPTVaxVPcxnNvkSVqo","dynamics":[],"chunks":[]}