Update with-userbase Example (#14100)

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.
This commit is contained in:
Matthew Sweeney 2020-06-12 02:20:52 +01:00 committed by GitHub
parent d23c22c544
commit 7e16f7f43b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 17 deletions

View file

@ -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
@ -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.

View file

@ -1,5 +1,5 @@
{
"name": "with-tailwindcss",
"name": "with-userbase",
"version": "1.0.0",
"scripts": {
"dev": "next",

View file

@ -1,7 +0,0 @@
{
"build": {
"env": {
"NEXT_PUBLIC_USERBASE_APP_ID": "@userbase-app-id"
}
}
}