Skip to content

Commit

Permalink
Update with-userbase Example (#14100)
Browse files Browse the repository at this point in the history
This PR updates the `with-userbase` example with the following changes:

- Removes the `vercel.json` file, this is no longer needed with [recent changes](https://vercel.com/docs/v2/build-step#environment-variables).
- Changes the URL of the Deploy Button to use `?env`, `?envLink`, and `?envDescription` query strings, these prompt for environment variables upon import.
- Updates the instructions to reflect the changes made to the import and deployment process.
  • Loading branch information
mcsdevv authored Jun 12, 2020
1 parent d23c22c commit 7e16f7f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
12 changes: 3 additions & 9 deletions examples/with-userbase/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Deployed Demo: [https://next-userbase.now.sh](https://next-userbase.now.sh)

Deploy the example using [Vercel](https://vercel.com):

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/next.js/tree/canary/examples/with-userbase)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/git?s=https://github.com/vercel/next.js/tree/canary/examples/with-userbase&env=NEXT_PUBLIC_USERBASE_APP_ID&envDescription=encodeURI(The Userbase app ID, found in the Userbase dashboard.&envLink=https://v1.userbase.com/#))

## How to use

Expand Down Expand Up @@ -85,12 +85,6 @@ Your todo app should be up and running on [http://localhost:3000](http://localho

You can deploy this app to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).

To deploy on Vercel, you need to set the environment variables using the [Vercel CLI](https://vercel.com/download) ([Documentation](https://vercel.com/docs/cli#commands/secrets)).
To deploy on Vercel, you need to set the environment variable using the [Vercel dashboard](https://vercel.com/dashboard) ([Documentation](https://vercel.com/docs/v2/build-step#environment-variables)).

Install [Vercel CLI](https://vercel.com/download), log in to your account from the CLI, and run the following command to add the environment variable. Replace <NEXT_PUBLIC_USERBASE_APP_ID> with the corresponding string in `.env.local`:

```
vercel secrets add userbase-app-id <NEXT_PUBLIC_USERBASE_APP_ID>
```

Then push the project to GitHub/GitLab/Bitbucket and [import to Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) to deploy.
You can do this when importing your project by selecting the environment variables dropdown, and using a name of `NEXT_PUBLIC_USERBASE_APP_ID` with the [Userbase app ID](https://v1.userbase.com/#) as the value.
2 changes: 1 addition & 1 deletion examples/with-userbase/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "with-tailwindcss",
"name": "with-userbase",
"version": "1.0.0",
"scripts": {
"dev": "next",
Expand Down
7 changes: 0 additions & 7 deletions examples/with-userbase/vercel.json

This file was deleted.

0 comments on commit 7e16f7f

Please sign in to comment.