Skip to content

Latest commit

 

History

History

README.md

Next.js InsForge Starter

The fastest way to build apps with Next.js and InsForge

Demo · Features · Quick launch · Clone and run locally · Deploy to Vercel

Next.js InsForge Starter homepage


Demo

Check out the live demo: demonextjs.insforge.site

Features

  • 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

Quick launch

If you want the fastest path, use the InsForge CLI and follow the prompts:

npx @insforge/cli create

From there:

  1. Choose the Next.js starter template
  2. Follow the prompt flow to create or connect your InsForge project
  3. Let the CLI handle the initial setup
  4. Choose to deploy with InsForge from the guided flow

Use the sections below if you want to set up the starter manually.

Clone and run locally

  1. Clone this repository and move into the starter directory.
git clone https://github.com/InsForge/insforge-templates.git
cd insforge-templates/nextjs
  1. Install dependencies.
npm install
  1. Go to the InsForge dashboard, create a project, and click ConnectCLI to get the link command:
npx @insforge/cli link --project-id <your-project-id>
  1. Copy .env.example to .env.local and update the values with your InsForge project settings (find these in the InsForge dashboard under ConnectAPI Keys):
cp .env.example .env.local

Set 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.site

You can find the project URL and anon key in your InsForge project settings.

  1. Start the development server.
npm run dev

The starter should now be running on localhost:3000.

Deploy to Vercel

Click Deploy with Vercel, then fill in the required environment variables during the setup flow:

  • NEXT_PUBLIC_INSFORGE_URL
  • NEXT_PUBLIC_INSFORGE_ANON_KEY
  • NEXT_PUBLIC_APP_URL with your production Vercel URL, for example https://your-project.vercel.app

Deploy with Vercel

The above will also clone the starter kit to your GitHub, so you can clone it locally and continue development there.