Skip to main content
import { AuthFlowType, B2BProducts, StytchB2B } from "@stytch/react/b2b";

const discoveryConfig = {
  authFlowType: AuthFlowType.Discovery,
  products: [B2BProducts.emailMagicLinks, B2BProducts.oauth],
  emailMagicLinksOptions: {
    discoveryRedirectURL: 'https://example.com/authenticate',
  },
  oauthOptions: {
    discoveryRedirectURL: 'https://example.com/authenticate',
    providers: [
      { type: 'google', one_tap: true, cancel_on_tap_outside: false },
      { type: 'microsoft' },
    ],
  },
  sessionOptions: {
    sessionDurationMinutes: 60,
  },
};

// Render the StytchB2B component
<StytchB2B config={discoveryConfig} />
To build a login page that allows a Member to log in to any Organization they are a part of or (if enabled) create a new Organization, set up a generic login page that renders the StytchB2B component with authFlowType set to Discovery.