attach
Creates an OAuth attach token that can be used to link an OAuth provider to an existing authenticated session. Calls the POST /sdk/v1/oauth/attach endpoint. Pass the returned attach token as oauthAttachToken in a subsequent OAuthType.start call.
Kotlin:
StytchConsumer.oauth.attach(
OAuthAttachParameters(provider = "google")
)Content copied to clipboard
iOS:
let params = OAuthAttachParameters(provider: "google")
let response = try await StytchConsumer.oauth.attach(params)Content copied to clipboard
React Native:
StytchConsumer.oauth.attach({ provider: "google" })Content copied to clipboard
Return
OAuthAttachResponse containing the oauthAttachToken to pass to OAuthType.start.
Parameters
request
IOAuthAttachParameters
provider— The OAuth provider identifier (e.g."google","apple","github").
Throws
StytchError
if the request fails or no active session exists.
if the coroutine is cancelled.