Skip to main content

Overview

The Fortt React SDK provides components and hooks to integrate Fortt into your React or Next.js application. All backend API communication is handled automatically—you only need to work with the React components and hooks.

Components

<ForttProvider />

The main provider component that wraps your application and enables Fortt functionality. It automatically handles page view tracking and provides Fortt context to all child components.

Props

projectId
string
required
Your unique Fortt project identifier. This is required to connect your application to your Fortt project. Getting your projectId: To start your trial and receive your projectId, contact rafael@fortt.sh. You’ll receive your project identifier after starting your trial.
children
React.ReactNode
required
The child components that will have access to the Fortt context. Typically, this is your entire application or a portion that needs protection.
ignorePaths
string[]
Array of path patterns to skip automatic verification on. Supports exact matches and wildcard patterns. When a page matches any pattern in this array, Fortt will not automatically send verification requests on page load. Pattern Examples: - '/dashboard' - Exact match for /dashboard - '/admin/*' - Matches /admin and all subpaths like /admin/users, /admin/settings, etc. This is useful for excluding internal pages, admin panels, or dashboard pages where you don’t want automatic verification to occur.

Example

import { ForttProvider } from 'fortt/react';

function App() {
  return (
    <ForttProvider projectId="your-project-id">
      {/* Your app components */}
    </ForttProvider>
  );
}
Example with ignorePaths:
import { ForttProvider } from 'fortt/react';

function App() {
  return (
    <ForttProvider
      projectId="your-project-id"
      ignorePaths={['/dashboard', '/admin/*', '/internal']}
    >
      {/* Your app components */}
    </ForttProvider>
  );
}

Behavior

When ForttProvider is mounted, it automatically:
  • Initializes device fingerprinting
  • Creates or retrieves visitor and session identifiers
  • Sends verification requests on page load
  • Manages all API communication in the background
All of this happens silently with zero visual impact on your users.

Hooks

Additional hooks for protecting specific actions will be available soon. Currently, ForttProvider handles all verification automatically through page view tracking.

Next Steps

  • Check out the quickstart guide to integrate Fortt into your app
  • Visit the FAQ for common questions about integration and usage