Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

API reference

Kinde API reference

Kinde auth and access control

Identifiers
103
With full guides
63
Types
7

Topics covered

  • Setup
  • Login flows
  • Permissions & roles
  • Feature flags
  • Organizations
  • Tokens
  • Webhooks
  • Next.js SDK

Component

NameWhat it does
KindeProviderKindeProvider configures the Kinde React SDK and supplies authentication context to the application tree. Set the client, domain, redirect URIs, and optionally an API audience or scope.
LoginLinkLoginLink is a Kinde React SDK component that starts sign-in when activated. Render it with the content users should click.
LogoutLinkLogoutLink is Kinde’s React component for ending the current user session. Render it with child content such as a “Sign out” label.
RegisterLinkRegisterLink is a Kinde Next.js component for starting user registration. Render it with link content, and optionally provide orgCode to target a specific organization.
CreateOrgLinkCreateOrgLink is a Next.js App Router SDK component for starting organization creation. It redirects the user to Kinde and creates the organization with that user as a member.

Function

NameWhat it does
getKindeServerSessiongetKindeServerSession provides server-side Kinde authentication data in Next.js App Router server components. Use its returned methods to check authentication and retrieve user, authorization, organization, or token information.
getUsergetUser() returns the current user’s profile from the Kinde JavaScript client. Its result is a KindeUser, with profile fields typed as string | undefined.
getPermissionsgetPermissions asynchronously returns all permissions for the current user in the organization they are signed in to. The result includes the organization code and an array of permission keys.
getRolesgetRoles asynchronously returns the current user's roles as an array of Role objects. It requires the roles claim to be enabled in the application's token settings.
getBooleanFlagFunction
getStringFlagRetrieves a string feature flag from the user's access token. An optional string fallback handles a flag that is not found.
getOrganizationRetrieves details for the organization associated with the signed-in user. In the TypeScript SDK, it is called with a session manager and returns an object containing the organization code.
getUserOrganizationsRetrieves an array of every organization the authenticated user can access. In the React SDK, call it from useKindeAuth() and await the result.
refreshTokensFunction
getClaimgetClaim asynchronously retrieves one named claim from the current access or ID token. It reads the access token by default, or the ID token when passed idToken.
getAccessTokengetAccessToken() asynchronously reads Kinde’s cached raw access-token JWT for use in API requests. It does not refresh the token and can return undefined or an expired token.
isAuthenticatedisAuthenticated checks whether the current Kinde session represents an authenticated user. In a Next.js server component, call it through getKindeServerSession and await the boolean result.
handleAuthhandleAuth() creates the Next.js route handler for Kinde authentication endpoints. In the App Router, export it as the route’s GET handler from app/api/auth/[kindeAuth]/route.ts.
authMiddlewareFunction
withAuthFunction

Hook

NameWhat it does
useKindeAuthuseKindeAuth provides Kinde authentication data inside a component. Use it to read authorized-user information or obtain an access token for protected API requests.
useKindeBrowserClientA client-component hook for reading an authorized user’s Kinde authentication data in Next.js. It also provides helpers for organizations, permissions, and refreshing data.

Type Alias

NameWhat it does
KindeUserType Alias
KindeOrganizationType Alias
KindePermissionType Alias
KindeFlagType Alias
KindeAccessTokenType Alias
KindeIdTokenType Alias
SessionManagerSessionManager is the Kinde TypeScript SDK interface for storing authentication-session data. Implement it with a key-value store and pass the adapter to SDK authentication methods.

Const

NameWhat it does
PKCEPKCE is Kinde’s secure Authorization Code variant for public clients such as SPAs and mobile apps. It replaces a stored client secret with a verifier-and-challenge proof.
AudienceConst
ScopesKinde OAuth scopes specify the protected user information or offline capability an application requests. Standard values include openid, email, profile, and offline.
ConnectionsConst
M2M tokensM2M tokens are OAuth 2.0 access tokens for backend services, scripts, and automation that operate without a user. Kinde issues them through the client credentials flow for an API audience, with optional scopes and organization context.
Custom claimsCustom claims let Kinde workflows add application-specific data to access or ID tokens. They can also be supplied through public properties or token customization.
Feature flagsKinde feature flags control feature visibility or behavior for selected users, organizations, environments, or the whole application. They use typed values and can be inherited or overridden at supported scopes.
Multi-tenancyKinde models multi-tenancy with organizations: one Kinde business can serve multiple customers while separating their users, access, and tenant data. Use a flat organization set within a business; separate Kinde businesses are required for independent projects.
OrganizationsOrganizations group Kinde users into business or tenant-like units such as companies or departments. Users may belong to multiple organizations, with roles and permissions that can differ by organization.
Roles and permissionsConst
WebhooksKinde webhooks notify your application when configured account events occur. Kinde sends event data in a JWT to your registered endpoint, which should verify, process, and acknowledge the request with HTTP 200.
Custom domainsKinde custom domains let a production environment use your own authentication URL instead of its Kinde subdomain. Add the domain in environment settings, publish Kinde’s CNAME records, then update the application’s issuer and redirect URLs.
BrandingKinde global brand defaults customize Kinde-hosted authentication pages with your business identity. Configure them in the dashboard; changes apply immediately without redeploying application code.
MFAMFA requires users to prove their identity with at least two authentication factors. Kinde lets you make MFA mandatory or optional and supports email, SMS, and authenticator-app verification.
PasswordlessKinde Passwordless authentication lets users sign in without maintaining passwords, using one-time passcodes delivered through configured email, phone, or username connections. Codes expire after two hours.
Social connectionsSocial connections let users sign up and sign in with existing social-account credentials. Configure a provider in Kinde’s Authentication settings, then enable it for the applications that should offer it.
Enterprise SSOConst
SAMLSAML is an authentication protocol for Kinde enterprise connections. Kinde acts as the service provider, while an external identity provider authenticates users; the Entity ID identifies the connection and must match on both sides.
Token customizationKinde token customization lets you add preset claims and properties to application tokens. Configure it per application for access, ID, or M2M tokens in the Kinde dashboard.
OIDCConst
Events APIConst
Property APIConst
Self-serve portalKinde’s self-serve portal lets authorized users and organization members manage configured account functions without contacting support. Configure its available capabilities, return URL, and permissions, then open it with a one-time link.
BillingConst
EntitlementsEntitlements are billing-plan capabilities that describe what a customer is allowed to use. Kinde SDK helpers can read all entitlements, retrieve one by key, or check billing-entitlement membership for a user.
PlansConst
MetersConst
AgreementsConst
MFA enforcementKinde lets administrators make MFA mandatory or optional for users. Environment settings apply globally, while organization-level settings can narrow enforcement to one organization.
Custom propertiesCustom properties are user-defined fields for Kinde users, organizations, and applications. They store business-specific data and can be exposed in tokens as custom claims when configured as public.
Pre-registration workflowKinde’s user:pre_registration workflow runs after single-factor authentication and before a user record is created. Use it to validate registration inputs or block risky sign-ups.
Post-authentication workflowThe user:post_authentication workflow runs after single-factor authentication. Use it for post-login checks, user enrichment, organization assignment, and first-time-user handling before authorization continues.
Token customization workflowConst
M2M applicationAn M2M application authenticates backend services, scripts, or automation tools without a user. It uses OAuth 2.0 client credentials to obtain access tokens for Kinde APIs or your own APIs.
First-party applicationA first-party application is an OAuth application for your own product, managed under Kinde’s Customer identity area. It lets product code receive access tokens through OAuth 2.0.
Third-party applicationConst
Connected appsKinde connected apps let users access third-party services through Kinde. Configure a provider with credentials, callback URLs, a code-facing reference key, and selected scopes.
DashboardConst
Sign-in policiesConst
Session managementKinde session management configures application-level SSO cookie persistence and inactivity re-authentication. Backends can also terminate a user’s sessions through the Management API.

Module

NameWhat it does
getPermissionChecks whether the current user has a specified permission in the active organization. It returns the permission key, organization code, and a boolean access result.
getClaimValuegetClaimValue extracts the value of a named claim from the current session's access or ID token. It defaults to the access token unless you provide id_token.
getFlagModule
getIntegerFlagGets an integer feature flag for the current Kinde session. A numeric default can be supplied for an unset flag.
getAccessTokenRawgetAccessTokenRaw asynchronously retrieves the raw access token through the Next.js App Router server-session API. Use it when server-side code needs the token value itself.
getIdTokengetIdToken asynchronously returns Kinde’s raw ID token from memory. It accepts no arguments and may resolve to undefined when no ID token is available.
getTokenModule
loginKinde's TypeScript SDK login method creates a redirect URL for sign-in. Call it from a login route and redirect the browser to the returned URL.
registerThe Kinde TypeScript SDK register method creates a redirect URL for hosted user sign-up. Expose it through an application route and redirect the browser to the returned URL.
logoutThe TypeScript SDK’s logout method creates a Kinde logout URL from a session manager. Redirect the user to that URL to complete sign-out and return them to the configured post-logout destination.
createOrgModule
Users APIModule
Organizations APIModule
Roles APIThe Roles API lets applications manage Kinde roles and their organization-user assignments through the Management API. Roles package permissions into reusable groups, with access controlled by dedicated M2M token scopes.
Permissions APIModule
Feature Flags APIKinde’s Feature Flags API lets authenticated machine-to-machine clients create, edit, override, and delete feature flags through the Management API. API-created flags support string, integer, and boolean types; JSON flags must be created in the dashboard.
Connections APIModule
Applications APIKinde applications are OAuth 2.0 clients that receive access tokens for application code. Select the application type that matches the client, then authorize APIs and request their audience when API access is required.
Business APIModule
Subscribers APIModule
APIs APIKinde API registration gives an API a name and unique audience, then lets you authorize applications to use it. A linked API can be included in access-token audience claims for backend authentication.
getUserProfilegetUserProfile asynchronously returns the profile of the currently logged-in user in Kinde’s React SDK. Obtain it from useKindeAuth and call it without arguments.
getUserPropertiesModule
getUserPropertyModule
setUserPropertyModule
getEntitlementsModule
getEntitlementModule
generatePortalUrlgeneratePortalUrl creates a URL for the Kinde portal. In the React SDK, await the result and navigate to its url value, optionally supplying a return path.

Pipe

NameWhat it does
KINDE_SITE_URLPipe
KINDE_ISSUER_URLKINDE_ISSUER_URL stores the HTTPS domain of the Kinde tenant that issues tokens. Backend SDKs or JWT validators use it to verify that tokens come from the expected issuer.
KINDE_CLIENT_IDKINDE_CLIENT_ID is the environment variable for your Kinde application’s unique Client ID. Find it on the application details page and provide it to the SDK configuration.
KINDE_CLIENT_SECRETKINDE_CLIENT_SECRET stores the confidential secret issued for a Kinde application. Configure it in environment settings for back-end or M2M authentication, and keep it out of source control and client-side code.
KINDE_POST_LOGIN_REDIRECT_URLKINDE_POST_LOGIN_REDIRECT_URL is an environment variable that sets where users go after authenticating. The Next.js App Router SDK also supports a per-login destination through post_login_redirect_url or postLoginRedirectURL.
KINDE_POST_LOGOUT_REDIRECT_URLKINDE_POST_LOGOUT_REDIRECT_URL is the Kinde environment variable for the URL users should reach after signing out. Register the same URL as an allowed logout redirect URL in Kinde.

Search across every package and filter by type in your dashboard.

Start learning