From 7e16f7f43b6c9bdf3f98f92151f639a780236e2b Mon Sep 17 00:00:00 2001 From: Matthew Sweeney Date: Fri, 12 Jun 2020 02:20:52 +0100 Subject: [PATCH] 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. --- examples/with-userbase/README.md | 12 +++--------- examples/with-userbase/package.json | 2 +- examples/with-userbase/vercel.json | 7 ------- 3 files changed, 4 insertions(+), 17 deletions(-) delete mode 100644 examples/with-userbase/vercel.json diff --git a/examples/with-userbase/README.md b/examples/with-userbase/README.md index 57a704a80f..8e98a36e0a 100644 --- a/examples/with-userbase/README.md +++ b/examples/with-userbase/README.md @@ -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 with the corresponding string in `.env.local`: - -``` -vercel secrets add 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. diff --git a/examples/with-userbase/package.json b/examples/with-userbase/package.json index 8659f177aa..bd4eae0f76 100644 --- a/examples/with-userbase/package.json +++ b/examples/with-userbase/package.json @@ -1,5 +1,5 @@ { - "name": "with-tailwindcss", + "name": "with-userbase", "version": "1.0.0", "scripts": { "dev": "next", diff --git a/examples/with-userbase/vercel.json b/examples/with-userbase/vercel.json deleted file mode 100644 index 45cf8797c4..0000000000 --- a/examples/with-userbase/vercel.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "build": { - "env": { - "NEXT_PUBLIC_USERBASE_APP_ID": "@userbase-app-id" - } - } -} -- GitLab