| 
 | 1 | +<a href="https://demo-nextjs-with-supabase.vercel.app/">  | 
 | 2 | +  <img alt="Next.js and Supabase Starter Kit - the fastest way to build apps with Next.js and Supabase" src="https://demo-nextjs-with-supabase.vercel.app/opengraph-image.png">  | 
 | 3 | +  <h1 align="center">Next.js and Supabase Starter Kit</h1>  | 
 | 4 | +</a>  | 
 | 5 | + | 
 | 6 | +<p align="center">  | 
 | 7 | + The fastest way to build apps with Next.js and Supabase  | 
 | 8 | +</p>  | 
 | 9 | + | 
 | 10 | +<p align="center">  | 
 | 11 | +  <a href="#features"><strong>Features</strong></a> ·  | 
 | 12 | +  <a href="#demo"><strong>Demo</strong></a> ·  | 
 | 13 | +  <a href="#deploy-to-vercel"><strong>Deploy to Vercel</strong></a> ·  | 
 | 14 | +  <a href="#clone-and-run-locally"><strong>Clone and run locally</strong></a> ·  | 
 | 15 | +  <a href="#feedback-and-issues"><strong>Feedback and issues</strong></a>  | 
 | 16 | +  <a href="#more-supabase-examples"><strong>More Examples</strong></a>  | 
 | 17 | +</p>  | 
 | 18 | +<br/>  | 
 | 19 | + | 
 | 20 | +## Features  | 
 | 21 | + | 
 | 22 | +- Works across the entire [Next.js](https://nextjs.org) stack  | 
 | 23 | +  - App Router  | 
 | 24 | +  - Pages Router  | 
 | 25 | +  - Middleware  | 
 | 26 | +  - Client  | 
 | 27 | +  - Server  | 
 | 28 | +  - It just works!  | 
 | 29 | +- supabase-ssr. A package to configure Supabase Auth to use cookies  | 
 | 30 | +- Password-based authentication block installed via the [Supabase UI Library](https://supabase.com/ui/docs/nextjs/password-based-auth)  | 
 | 31 | +- Styling with [Tailwind CSS](https://tailwindcss.com)  | 
 | 32 | +- Components with [shadcn/ui](https://ui.shadcn.com/)  | 
 | 33 | +- Optional deployment with [Supabase Vercel Integration and Vercel deploy](#deploy-your-own)  | 
 | 34 | +  - Environment variables automatically assigned to Vercel project  | 
 | 35 | + | 
 | 36 | +## Demo  | 
 | 37 | + | 
 | 38 | +You can view a fully working demo at [demo-nextjs-with-supabase.vercel.app](https://demo-nextjs-with-supabase.vercel.app/).  | 
 | 39 | + | 
 | 40 | +## Deploy to Vercel  | 
 | 41 | + | 
 | 42 | +Vercel deployment will guide you through creating a Supabase account and project.  | 
 | 43 | + | 
 | 44 | +After installation of the Supabase integration, all relevant environment variables will be assigned to the project so the deployment is fully functioning.  | 
 | 45 | + | 
 | 46 | +[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fnext.js%2Ftree%2Fcanary%2Fexamples%2Fwith-supabase&project-name=nextjs-with-supabase&repository-name=nextjs-with-supabase&demo-title=nextjs-with-supabase&demo-description=This+starter+configures+Supabase+Auth+to+use+cookies%2C+making+the+user%27s+session+available+throughout+the+entire+Next.js+app+-+Client+Components%2C+Server+Components%2C+Route+Handlers%2C+Server+Actions+and+Middleware.&demo-url=https%3A%2F%2Fdemo-nextjs-with-supabase.vercel.app%2F&external-id=https%3A%2F%2Fgithub.com%2Fvercel%2Fnext.js%2Ftree%2Fcanary%2Fexamples%2Fwith-supabase&demo-image=https%3A%2F%2Fdemo-nextjs-with-supabase.vercel.app%2Fopengraph-image.png)  | 
 | 47 | + | 
 | 48 | +The above will also clone the Starter kit to your GitHub, you can clone that locally and develop locally.  | 
 | 49 | + | 
 | 50 | +If you wish to just develop locally and not deploy to Vercel, [follow the steps below](#clone-and-run-locally).  | 
 | 51 | + | 
 | 52 | +## Clone and run locally  | 
 | 53 | + | 
 | 54 | +1. You'll first need a Supabase project which can be made [via the Supabase dashboard](https://database.new)  | 
 | 55 | + | 
 | 56 | +2. Create a Next.js app using the Supabase Starter template npx command  | 
 | 57 | + | 
 | 58 | +   ```bash  | 
 | 59 | +   npx create-next-app --example with-supabase with-supabase-app  | 
 | 60 | +   ```  | 
 | 61 | + | 
 | 62 | +   ```bash  | 
 | 63 | +   yarn create next-app --example with-supabase with-supabase-app  | 
 | 64 | +   ```  | 
 | 65 | + | 
 | 66 | +   ```bash  | 
 | 67 | +   pnpm create next-app --example with-supabase with-supabase-app  | 
 | 68 | +   ```  | 
 | 69 | + | 
 | 70 | +3. Use `cd` to change into the app's directory  | 
 | 71 | + | 
 | 72 | +   ```bash  | 
 | 73 | +   cd with-supabase-app  | 
 | 74 | +   ```  | 
 | 75 | + | 
 | 76 | +4. Rename `.env.example` to `.env.local` and update the following:  | 
 | 77 | + | 
 | 78 | +   ```  | 
 | 79 | +   NEXT_PUBLIC_SUPABASE_URL=[INSERT SUPABASE PROJECT URL]  | 
 | 80 | +   NEXT_PUBLIC_SUPABASE_ANON_KEY=[INSERT SUPABASE PROJECT API ANON KEY]  | 
 | 81 | +   ```  | 
 | 82 | + | 
 | 83 | +   Both `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_ANON_KEY` can be found in [your Supabase project's API settings](https://supabase.com/dashboard/project/_?showConnect=true)  | 
 | 84 | + | 
 | 85 | +5. You can now run the Next.js local development server:  | 
 | 86 | + | 
 | 87 | +   ```bash  | 
 | 88 | +   npm run dev  | 
 | 89 | +   ```  | 
 | 90 | + | 
 | 91 | +   The starter kit should now be running on [localhost:3000](http://localhost:3000/).  | 
 | 92 | + | 
 | 93 | +6. This template comes with the default shadcn/ui style initialized. If you instead want other ui.shadcn styles, delete `components.json` and [re-install shadcn/ui](https://ui.shadcn.com/docs/installation/next)  | 
 | 94 | + | 
 | 95 | +> Check out [the docs for Local Development](https://supabase.com/docs/guides/getting-started/local-development) to also run Supabase locally.  | 
 | 96 | +
  | 
 | 97 | +## Feedback and issues  | 
 | 98 | + | 
 | 99 | +Please file feedback and issues over on the [Supabase GitHub org](https://github.com/supabase/supabase/issues/new/choose).  | 
 | 100 | + | 
 | 101 | +## More Supabase examples  | 
 | 102 | + | 
 | 103 | +- [Next.js Subscription Payments Starter](https://github.com/vercel/nextjs-subscription-payments)  | 
 | 104 | +- [Cookie-based Auth and the Next.js 13 App Router (free course)](https://youtube.com/playlist?list=PL5S4mPUpp4OtMhpnp93EFSo42iQ40XjbF)  | 
 | 105 | +- [Supabase Auth and the Next.js App Router](https://github.com/supabase/supabase/tree/master/examples/auth/nextjs)  | 
0 commit comments