Protected by MagenTrust
    MAGEN
    MAGEN Docs

    Integration Guide

    Integrate MagenTrust into your application to distinguish verifiable human activity from unverifiable or high-risk traffic.

    What MagenTrust Provides

    MagenTrust is a privacy-preserving, edge-first verification layer. It does not block traffic by default. Instead, it provides:

    Session Verification

    Context for each user session

    Funnel Insights

    Identify contamination sources

    Human Attribution

    Human-only conversion tracking

    Evidence & Explainability

    Explain traffic discrepancies

    Architecture

    Client-Side

    • • Lightweight JavaScript SDK (React hook or vanilla JS)
    • • Passive, non-blocking initialization
    • • Optional soft or hard gating at high-value actions

    Edge-Side (MAGEN-hosted)

    • • API endpoints deployed at the edge
    • • Stateless request handling
    • • API key + site-based authorization
    • • Low-latency verification responses

    Privacy-first: No cookies required. No PII collected. No fingerprinting.

    Required Identifiers

    siteId

    A logical identifier for the site or client being monitored. Enables multi-tenant agency deployments.

    apiKey

    A public client key used to authorize requests and enforce quotas. Keys are rate-limited and domain-restricted.

    Onboarding Flow

    Step 1

    Generate API Key

    Create your API credentials in the dashboard

    Step 2

    Register Domains

    Add allowed domains for your integration

    Step 3

    Assign Site IDs

    Create logical identifiers for each client or site

    Step 4

    Install SDK

    Add the React hook or vanilla JS snippet

    Step 5

    Receive Context

    Start getting verification signals

    Integration Options

    import { useMAGEN } from '@magen/react';
    
    function CheckoutForm() {
      const { verify, isVerifying, result } = useMAGEN({
        siteId: 'your-site-id',
        apiKey: 'your-api-key',
      });
    
      const handleSubmit = async (e: FormEvent) => {
        e.preventDefault();
        
        const verification = await verify();
        
        if (verification.verdict === 'verified') {
          // Proceed with form submission
          await submitLead(formData, verification.session_id);
        } else {
          // Handle unverified traffic
          showFrictionStep();
        }
      };
    
      return (
        <form onSubmit={handleSubmit}>
          {/* Form fields */}
          <button type="submit" disabled={isVerifying}>
            {isVerifying ? 'Verifying...' : 'Submit'}
          </button>
        </form>
      );
    }

    For modern React apps. Install with npm install @magen/react

    Gating Philosophy

    MagenTrust supports three policy modes. Teams control gating behavior—MagenTrust does not enforce blocking by default.

    observe

    Never block, only observe and collect context

    soft

    Allow with warnings or friction for suspicious traffic

    hard

    Block only when confidence is high