import { StytchB2BClient } from '@stytch/vanilla-js/b2b';const stytch = new StytchB2BClient('public-token-test-b8c84de4-7d58-4ffc-9341-432b56596862');// Authenticate using the token in the URLstytch.authenticateByUrl();
import { StytchB2BClient } from '@stytch/vanilla-js/b2b';const stytch = new StytchB2BClient('public-token-test-b8c84de4-7d58-4ffc-9341-432b56596862');// Authenticate using the token in the URLstytch.authenticateByUrl();
Discovery
Discovery Authenticate
Authenticate using discovery OAuth with the Stytch Vanilla JS SDK
import { StytchB2BClient } from '@stytch/vanilla-js/b2b';const stytch = new StytchB2BClient('public-token-test-b8c84de4-7d58-4ffc-9341-432b56596862');// Authenticate using the token in the URLstytch.authenticateByUrl();
import { StytchB2BClient } from '@stytch/vanilla-js/b2b';const stytch = new StytchB2BClient('public-token-test-b8c84de4-7d58-4ffc-9341-432b56596862');// Authenticate using the token in the URLstytch.authenticateByUrl();
oauth.$provider.discovery.authenticate() wraps the Authenticate Discovery OAuth API endpoint which validates the OAuth token passed in. If this method succeeds, the token will be stored in the browser as a cookie.Use one of the following methods to authenticate a Discovery OAuth token:
oauth.google.discovery.authenticate()
oauth.microsoft.discovery.authenticate()
oauth.hubspot.discovery.authenticate()
oauth.slack.discovery.authenticate()
oauth.github.discovery.authenticate()
Parameters
string
required
The Discovery OAuth token to authenticate.
Assistant
Responses are generated using AI and may contain mistakes.