Turnkey home page
Search...
⌘K
Ask AI
Demo
Login
Get started
Get started
Search...
Navigation
SDK reference
addOauthProvider()
Documentation
SDK reference
API reference
Security
Changelogs
Support
Blog
Contact us
SDK reference
Introduction
React
Overview
Getting started
Authentication
Using embedded wallets
Using external wallets
Signing
UI customization
Sub-organization customization
Advanced API requests
Advanced backend authentication
Troubleshooting
Legacy (@turnkey/sdk-react)
SDK reference
addOauthProvider()
addPasskey()
clearAllSessions()
clearSession()
clearUnusedKeyPairs()
completeOauth()
completeOtp()
connectWalletAccount()
createApiKeyPair()
createPasskey()
createWallet()
createWalletAccounts()
deleteSubOrganization()
disconnectWalletAccount()
exportPrivateKey()
exportWallet()
exportWalletAccount()
fetchUser()
fetchWalletAccounts()
fetchWallets()
getActiveSessionKey()
getAllSessions()
getProxyAuthConfig()
getSession()
getWalletProviders()
handleAddEmail()
handleAddOauthProvider()
handleAddPasskey()
handleAddPhoneNumber()
handleAppleOauth()
handleExportPrivateKey()
handleExportWallet()
handleExportWalletAccount()
handleFacebookOauth()
handleGoogleOauth()
handleImportWallet()
handleConnectExternalWallet()
handleLogin()
handleRemoveOauthProvider()
handleRemovePasskey()
handleRemoveUserEmail()
handleRemoveUserPhoneNumber()
handleSignMessage()
handleUpdateUserEmail()
handleUpdateUserName()
handleUpdateUserPhoneNumber()
importPrivateKey()
importWallet()
initOtp()
loginOrSignupWithWallet()
loginWithOauth()
loginWithOtp()
loginWithPasskey()
loginWithWallet()
logout()
refreshSession()
refreshUser()
refreshWallets()
removeOauthProviders()
removePasskeys()
removeUserEmail()
removeUserPhoneNumber()
setActiveSession()
signAndSendTransaction()
signMessage()
signTransaction()
signUpWithOauth()
signUpWithOtp()
signUpWithPasskey()
signUpWithWallet()
storeSession()
switchWalletProviderChain()
updateUserEmail()
updateUserName()
updateUserPhoneNumber()
verifyOtp()
switchWalletAccountChain()
fetchPrivateKeys()
handleDiscordOauth()
handleImportPrivateKey()
handleXOauth()
React Native
Flutter
Swift
TypeScript | Frontend
TypeScript | Server
Golang
Rust
Ruby
CLI
Python
Web3 libraries
Advanced
Migration Path
SDK reference
addOauthProvider()
Copy page
Copy page
Package:
react-wallet-kit
Overview
Adds an OAuth provider to the user.
This function adds an OAuth provider (e.g., Google, Apple) to the user account.
If a userId is provided, it adds the provider for that specific user; otherwise, it uses the current session’s userId.
Automatically checks if an account already exists for the provided OIDC token and prevents duplicate associations.
If the user’s email is not set or not verified, attempts to update and verify the email using the email from the OIDC token.
Handles session management and error reporting for the add provider flow.
Optionally allows stamping the request with a specific stamper (StamperType.Passkey, StamperType.ApiKey, or StamperType.Wallet).
Parameters
params
object
required
Show params details
params.
oidcToken
string
required
OIDC token for the OAuth provider.
params.
providerName
string
required
name of the OAuth provider to add (e.g., “Google”, “Apple”).
params.
stampWith
StamperType
parameter to stamp the request with a specific stamper (StamperType.Passkey, StamperType.ApiKey, or StamperType.Wallet).
params.
userId
string
user ID to add the provider for a specific user (defaults to current session’s userId).
Response
A successful response returns the following fields:
returns
string[]
required
A promise that resolves to an array of provider IDs associated with the user.
Was this page helpful?
Yes
No
Legacy (@turnkey/sdk-react)
addPasskey()
Assistant
Responses are generated using AI and may contain mistakes.