/
Contact usSee pricingStart building

    About B2B Saas Authentication

    Introduction
    Stytch B2B Basics
    Integration Approaches
      Full-stack overview
      Frontend (pre-built UI)
      Frontend (headless)
      Backend
    Next.js
      Routing
      Authentication
      Sessions
    Migrations
      Overview
      Reconciling data models
      Migrating user data
      Additional migration considerations
      Zero-downtime deployment
      Defining external IDs for members
      Exporting from Stytch
    Custom Domains
      Overview

    Authentication

    Single Sign On
    • Resources

      • Overview
        External SSO Connections
        Standalone SSO
    • Integration Guides

      • Start here
        Backend integration guide
        Headless integration guide
        Pre-built UI integration guide
    OAuth
    • Resources

      • Overview
        Authentication flows
        Identity providers
        Google One Tap
        Provider setup
    • Integration Guides

      • Start here
        Backend integration
        Headless frontend integration
        Pre-built UI frontend integration
    Connected AppsBeta
      Setting up Connected Apps
      About Remote MCP Servers
    • Resources

      • Integrate with AI agents
        Integrate with a remote MCP server
    Sessions
    • Resources

      • Overview
        JWTs vs Session Tokens
        How to use Stytch JWTs
        Custom Claims
    • Integration Guides

      • Start here
        Backend integration
        Frontend integration
    Email OTP
      Overview
    Magic Links
    • Resources

      • Overview
        Email Security Scanner Protections
    • Integration Guides

      • Start here
        Backend integration
        Headless frontend integration
        Pre-built UI frontend integration
    Multi-Factor Authentication
    • Resources

      • Overview
    • Integration Guides

      • Start here
        Backend integration
        Headless frontend integration
        Pre-built UI frontend integration
    Passwords
      Overview
      Strength policies
    UI components
      Overview
      Implement the Discovery flow
      Implement the Organization flow
    DFP Protected Auth
      Overview
      Setting up DFP Protected Auth
      Handling challenges
    M2M Authentication
      Authenticate an M2M Client
      Rotate client secrets
      Import M2M Clients from Auth0

    Authorization & Provisioning

    RBAC
    • Resources

      • Overview
        Stytch Resources & Roles
        Role assignment
    • Integration Guides

      • Start here
        Backend integration
        Headless frontend integration
    SCIM
    • Resources

      • Overview
        Supported actions
    • Integration Guides

      • Using Okta
        Using Microsoft Entra
    Organizations
      Managing org settings
      JIT Provisioning

    Testing

    E2E testing
    Sandbox values
Get support on SlackVisit our developer forum

Contact us

B2B Saas Authentication

/

Guides

/

About B2B Saas Authentication

/

Integration Approaches

/

Full-stack overview

Integrating with Stytch

Stytch is architected to be embedded directly into your application, offering you flexibility and control over your integration and creating a seamless and native experience for users.

There are three different high level approaches to integrating Stytch directly into your application:

  1. Backend Integration: entirely server-side integration, where your backend calls Stytch's API through our backend SDK
  2. Headless Frontend Integration: your client invokes Stytch's headless frontend SDKs, which handles things like client-side session management out of the box, while providing flexibility in UX and UI
  3. Pre-built UI Frontend Integration: your client mounts the Stytch UI component on relevant routes, and the Stytch SDK handles the full login flow automatically

While we describe these as distinct integration options, most customers mix-and-match approaches to fit their needs. If you are using our pre-built UI for login, you might still leverage the headless methods for post-login changes (e.g. updating profile information) and if you are using our frontend SDKs, it is important to still do server-side session authentication checks with our backend SDKs for security reasons.

Integration methods

frontend prebuilt ui architecture diagramfrontend headless architecture diagrambackend architecture diagram

Choosing an integration approach

Stytch's frontend SDKs are built on top of our backend SDKs, and you can always change integration approaches in the future without any disruption to your application.

If you want to offload as much as possible to Stytch to start, we recommend using our frontend SDKs with pre-built UI components. If you want maximum flexibility and control, a backend-only integration might be a better fit.

If you're still undecided about which approach will best fit your use case and needs, see below for a detailed comparison of the differences between these integration approaches:

Frontend (pre-built UI)Frontend (headless)Backend
DevelopmentClient-side and server-sideClient-side and server-sideServer-side only
CustomizationCustomize UI styling; leverage callbacks for custom logic following successful auth flowCustomize UI entirely; some ability to add custom logic before/after calling StytchCustomize UI entirely; complete control over custom logic at any point before/after calling Stytch, including during multi-step auth flows
UIPre-built UI components for login and admin portalBuild your own custom UIBuild your own custom UI
AuthenticationAll user authentication methods availableAll user authentication methods availableAll user authentication methods available; M2M for server-to-server authentication available
Session ManagmentAutomatic session storage and managementAutomatic session storage and managementManual control over session storage and management
AuthorizationBuilt-in RBAC protections for Stytch methods; Helpers for viewing and checking the logged-in user's permissions (custom and Stytch defined) for easy conditional rendering of UIBuilt-in RBAC protections for Stytch methods; Helpers for viewing and checking the logged-in user's permissions (custom and Stytch defined) for easy conditional rendering of UIAbility to optionally use Stytch's RBAC for both Stytch permissions and custom permissions
Member and organization managementPre-built UI components for member and organization management, and SSO/SCIM setup; RBAC-gated and conditionally renderedRBAC-gated methods for most member and organization management actionsServer side methods available for all management actions; optional to use Stytch RBAC for authorization checks
FraudBuilt-in Device Fingerprinting Protected Auth (DFPPA) featuresBuilt-in Device Fingerprinting Protected Auth (DFPPA) featuresDevice Fingerprinting API; full control of when/where to fingerprint and how to action on response

Relevant Resources

Frontend

  • Frontend JS SDKs (headless and pre-built UI)
    • JavaScript SDK
    • Next.js SDK
    • React SDK
  • Mobile SDKs (headless)
    • iOS SDK
    • Android SDK
    • React Native SDK

Check out the React or Next.js quickstarts to test out a frontend integration approach!

Read the guide for implementing pre-built UI components and for using our frontend SDK headlessly for more in-depth implementation details and considerations.

Backend

  • Backend API
  • Backend SDKs
    • Go SDK
    • Python SDK
    • Node.js SDK
    • Ruby SDK
    • Java SDK

Check out the Node, Python, or Go quickstarts to test out a backend integration approach!

Read the backend implementation guide for more in-depth implementation details and considerations.

Still unsure what to choose?

If you have additional questions about our different integration options, please feel free to reach out to us in our community Slack, our developer forum, or at support@stytch.com for further guidance.

Integration methods

Choosing an integration approach

Relevant Resources

Frontend

Backend

Still unsure what to choose?