Overview
Kinde is an authentication and user management platform for modern SaaS applications. It supports social logins, email/SMS, passwordless, and MFA out of the box. This guide shows how to integrate Kinde with InsForge by signing a separate JWT server-side, since Kinde does not support custom JWT signing keys.- Live Demo — A sample app using Kinde authentication with InsForge
- Source Code — GitHub repository for the sample app
Prerequisites
- An InsForge project (self-hosted or cloud)
- A Kinde account and application
Step 1: Create a Kinde Application
- Log in to your Kinde Dashboard
- Select Add application
- Name your application and choose Back-end web as the type
- Select Next.js from the SDK list
- Configure callback URLs:
- Allowed callback URL:
http://localhost:3000/api/auth/kinde_callback - Allowed logout redirect URL:
http://localhost:3000
- Allowed callback URL:
- Enable desired authentication methods (Email, Google, etc.) under Authentication
- Under App Keys, note down the Domain, Client ID, and Client Secret
Step 2: Set Up Your InsForge Project
Create a new project or link an existing one:Step 3: Set Up Your Application
Install the required dependencies:.env.local:
app/api/auth/[kindeAuth]/route.js:
Step 4: Set Up InsForge Integration
Ask your agent to complete the following steps:1. Create the InsForge client utility
lib/insforge.ts) that gets the Kinde user via getKindeServerSession(), signs a JWT with the InsForge secret, and passes it as edgeFunctionToken.
2. Create the database schema
requesting_user_id() helper function (since Kinde user IDs are strings, not UUIDs) and a todos table with Row Level Security policies.
3. Build the todo list page
Step 5: Run Your Application
http://localhost:3000 and sign up with a new user through Kinde.
Since authentication is handled entirely by Kinde, you will not see any users in the InsForge dashboard under Auth > Users. User records are managed in the Kinde Dashboard — check Users there to confirm the sign-up was successful.
