Overview
The Embedded Wallet Kit makes authentication incredibly simple. With just one function call, you can trigger a login or signup modal that automatically reflects the authentication methods you’ve configured in your Turnkey Dashboard. You can also call specific login and signup functions to create your own UI components and authentication flow.Quick authentication
The easiest way to handle authentication is using thehandleLogin
function from the useTurnkey
hook. This will automatically show a modal with all the authentication methods you’ve enabled in your dashboard.
page.tsx

UI customization
Want to customize the look and feel of the authentication modal? You can learn more about customizing the UI components in the UI Customization section.Without a modal
If you need more control over the authentication flow, you can also call specific login and signup functions individually, without showing a modal.Knowing when users are authenticated
To check if a user is authenticated, you can use theauthState
variable from the useTurnkey
hook.
onAuthenticationSuccess
callback passed in through the TurnkeyProvider
to handle post-authentication logic, such as redirecting.
Configuring OAuth
Using OAuth requires additional configuration. To start, ensure you enable OAuth and check the OAuth providers you want to use in the Wallet Kit section of the Turnkey Dashboard. See the Getting Started guide for more details.

TurnkeyProvider
’s config. This is useful if you want to use different OAuth client IDs or a different redirect URL for different environments (e.g., development, staging, production).
Here, you can also toggle openOauthInPage
to true
if you want OAuth to replace the current page instead of opening a new popup.
TurnkeyProvider
config.
For example, for Google, you can create a web client ID in the Google developer console.


OAuth2.0 providers (X, Discord, etc)
For OAuth providers that exclusively use OAuth2.0 (e.g., X, Discord), you will need to configure a few additional settings in your Turnkey Dashboard. In the Wallet Kit section of the dashboard, head to the Socials tab and click Add provider.


TurnkeyProvider
’s config as shown above.
