examples/with-userbase/README.md
This is an example of using Userbase in a Next.js project.
Deployed Demo: https://next-userbase.vercel.app
Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example with-userbase next-userbase-app
yarn create next-app --example with-userbase next-userbase-app
pnpm create next-app --example with-userbase next-userbase-app
First, create an account on Userbase.
After creating an account, make note of your App ID which you'll be needing later.
Copy the .env.local.example file in this directory to .env.local (which will be ignored by Git):
cp .env.local.example .env.local
Then set the variable on .env.local:
NEXT_PUBLIC_USERBASE_APP_ID should be the App ID from when you created your Userbase account.Your .env.local file should look like this:
NEXT_PUBLIC_USERBASE_APP_ID=...
npm install
npm run dev
# or
yarn install
yarn dev
# or
pnpm install
pnpm dev
Your todo app should be up and running on http://localhost:3000! If it doesn't work, post on GitHub discussions.
You can deploy this app to the cloud with Vercel (Documentation).
To deploy your local project to Vercel, push it to GitHub/GitLab/Bitbucket and import to Vercel.
Important: When you import your project on Vercel, make sure to click on Environment Variables and set them to match your .env.local file.
Alternatively, you can deploy using our template by clicking on the Deploy button below.