The fastest way to build apps with Next.js and InsForge
Demo · Features · Quick launch · Clone and run locally · Deploy to Vercel
Check out the live demo: demonextjs.insforge.site
- Works across the Next.js App Router stack
- App Router
- Client Components
- Server Components
- Route Handlers
- Server Actions
- It just works
- InsForge auth configured to use cookies across the app
- Server-side auth actions using
@insforge/sdk - Optional Google and GitHub OAuth providers
- Starter homepage with environment setup guidance
- Protected example route that displays the signed-in user
- Styling with Tailwind CSS
- Ready for local development and Vercel deployment
If you want the fastest path, use the InsForge CLI and follow the prompts:
npx @insforge/cli createFrom there:
- Choose the Next.js starter template
- Follow the prompt flow to create or connect your InsForge project
- Let the CLI handle the initial setup
- Choose to deploy with InsForge from the guided flow
Use the sections below if you want to set up the starter manually.
- Clone this repository and move into the starter directory.
git clone https://github.com/InsForge/insforge-templates.git
cd insforge-templates/nextjs- Install dependencies.
npm install- Go to the InsForge dashboard, create a project, and click Connect → CLI to get the link command:
npx @insforge/cli link --project-id <your-project-id>- Copy
.env.exampleto.env.localand update the values with your InsForge project settings (find these in the InsForge dashboard under Connect → API Keys):
cp .env.example .env.localSet the following values in .env.local:
NEXT_PUBLIC_INSFORGE_URL=https://your-project.region.insforge.app
NEXT_PUBLIC_INSFORGE_ANON_KEY=your-anon-key
NEXT_PUBLIC_APP_URL=https://your-project.insforge.siteYou can find the project URL and anon key in your InsForge project settings.
- Start the development server.
npm run devThe starter should now be running on localhost:3000.
Click Deploy with Vercel, then fill in the required environment variables during the setup flow:
NEXT_PUBLIC_INSFORGE_URLNEXT_PUBLIC_INSFORGE_ANON_KEYNEXT_PUBLIC_APP_URLwith your production Vercel URL, for examplehttps://your-project.vercel.app
The above will also clone the starter kit to your GitHub, so you can clone it locally and continue development there.
