You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Vercel deployment will guide you through creating a Supabase account and project. After installation of the Supabase integration, all relevant environment variables will be set up so that the project is usable immediately after deployment 🚀
20
+
21
+
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fsupabase%2Fsupabase%2Ftree%2Fmaster%2Fexamples%2Fslack-clone%2Fnextjs-slack-clone&project-name=supabase-nextjs-slack-clone&repository-name=supabase-nextjs-slack-clone&integration-ids=oac_VqOgBHqhEoFTPzGkPd7L0iH6&external-id=https%3A%2F%2Fgithub.com%2Fsupabase%2Fsupabase%2Ftree%2Fmaster%2Fexamples%2Fslack-clone%2Fnextjs-slack-clone)
22
+
23
+
## Build from scratch
18
24
19
25
### 1. Create new project
20
26
@@ -36,62 +42,49 @@ The `anon` key is your client-side API key. It allows "anonymous access" to your
36
42
37
43
**_NOTE_**: The `service_role` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser.
38
44
39
-
### 4. Deploy the Next.js client
40
-
41
-
[](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fsupabase%2Fsupabase%2Ftree%2Fmaster%2Fexamples%2Fslack-clone%2Fnextjs-slack-clone&env=NEXT_PUBLIC_SUPABASE_URL,NEXT_PUBLIC_SUPABASE_ANON_KEY&envDescription=Find%20the%20Supabase%20URL%20and%20key%20in%20the%20your%20auto-generated%20docs%20at%20supabase.com/dashboard&project-name=supabase-slack-clone&repo-name=supabase-slack-clone)
42
-
43
-
Here, we recommend forking this repo so you can deploy through Vercel by clicking the button above. When you click the button, replace the repo URL with your fork's URL.
44
-
45
-
You will be asked for a `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_ANON_KEY`. Use the API URL and `anon` key from [step 3](#3-get-the-url-and-key).
46
-
47
-
### 5. Change authentication settings if necessary
On [supabase.com/dashboard](https://supabase.com/dashboard), you can go to Authentication -> Settings to change your auth settings for your project if necessary. Here, you can change the site URL, which is used for determining where to redirect users after they confirm their email addresses or attempt to use a magic link to log in.
52
-
53
-
Here, you can also enable external oauth providers, such as Google and GitHub.
54
-
55
-
## How to use
45
+
## Supabase details
56
46
57
-
### Using this repo
47
+
### Using a Remote Supabase Project
58
48
59
-
Simply clone this repo locally and proceed to the next section.
49
+
1. Create or select a project on [Supabase Dashboard](https://supabase.com/dashboard).
50
+
2. Copy and fill the dotenv template `cp .env.production.example .env.production`
51
+
3. Link the local project and merge the local configuration with the remote one:
60
52
61
-
### Required configuration
53
+
```bash
54
+
SUPABASE_ENV=production npx supabase@latest link --project-ref <your-project-ref>
55
+
```
62
56
63
-
Copy the `.env.example` file into a file named `.env.local` in the root directory of the example:
SUPABASE_ENV=production npx supabase@latest db push
74
67
```
75
68
76
-
### Change authentication settings if necessary
69
+
##Vercel Preview with Branching
77
70
78
-
Follow [Step #5](#5-change-authentication-settings-if-necessary) above if you want to change the auth settings.
71
+
Supabase integrates seamlessly with Vercel's preview branches, giving each branch a dedicated Supabase project. This setup allows testing database migrations or service configurations safely before applying them to production.
79
72
80
-
### Run the development server
73
+
### Steps
81
74
82
-
Now install the dependencies and start the development server.
75
+
1. Ensure the Vercel project is linked to a Git repository.
76
+
2. Configure the "Preview" environment variables in Vercel:
83
77
84
-
```bash
85
-
npm install
86
-
npm run dev
87
-
# or
88
-
yarn
89
-
yarn dev
90
-
```
78
+
-`NEXT_PUBLIC_SUPABASE_URL`
79
+
-`NEXT_PUBLIC_SUPABASE_ANON_KEY`
91
80
92
-
Visit http://localhost:3000 and start chatting! Open a channel across two browser tabs to see everything getting updated in realtime 🥳
81
+
3. Create a new branch, make changes (e.g., update `max_frequency`), and push the branch to Git.
82
+
- Open a pull request to trigger Vercel + Supabase integration.
83
+
- Upon successful deployment, the preview environment reflects the changes.
0 commit comments