Skip to content

Latest commit

 

History

History
102 lines (76 loc) · 4.14 KB

README.md

File metadata and controls

102 lines (76 loc) · 4.14 KB

InsForge Integrations

Sample applications showing how to integrate third-party authentication providers with InsForge. Each example is a standalone app that demonstrates JWT-based auth with InsForge's Row Level Security (RLS).

Integrations

Auth

Integration Framework Demo Guide
auth0 Next.js auth0auth.insforge.site Guide
clerk Next.js clerkauth.insforge.site Guide
kinde Next.js kindeauth.insforge.site Guide
stytch Next.js stytchauth.insforge.site Guide
workos Next.js workosauth.insforge.site Guide

Payment

Integration Framework Demo Guide
okx-x402 Next.js x402pay.insforge.site Guide

How It Works

Each integration follows the same pattern:

  1. User authenticates with the third-party provider.
  2. A JWT is signed with InsForge's JWT secret (either by the provider or server-side).
  3. The JWT is passed to the InsForge SDK as edgeFunctionToken.
  4. InsForge validates the token and enforces Row Level Security policies.

Since third-party auth providers use string-based user IDs (not UUIDs), all examples use a shared SQL helper function:

create or replace function public.requesting_user_id()
returns text
language sql stable
as $$
  select nullif(
    current_setting('request.jwt.claims', true)::json->>'sub',
    ''
  )::text
$$;

Repository Structure

insforge-integration/
├── auth/
│   ├── auth0/
│   ├── clerk/
│   ├── kinde/
│   ├── stytch/
│   └── workos/
└── payment/
    └── okx-x402/

Each directory is an independent application with its own dependencies, environment variables, and setup instructions.

Getting Started

  1. Clone the repository.
  2. Move into the integration you want to use.
  3. Install dependencies with npm install.
  4. Copy the integration's example environment file.
  5. Follow that integration's README.md for any required InsForge setup, provider configuration, and local development steps.

Per-Integration Documentation

For full setup details, go directly to the integration README you want to use:

Provide Feedback

  • Open an issue if you believe you've encountered a bug that you want to flag for the team.