This repository is for demonstration purposes. NextJS is not required to use Bridg. Bridg is compatible with any JS or TS frontend project.
-
git clone https://github.com/JoeRoddy/bridg-example-next-with-auth.git
and cd into directory -
npm install
-
npm run generate
-
Configure an OAuth provider for authentication with NextAuth.js.
For Github, as an example:
- Visit https://github.com/settings/developers
- Select "Oauth Apps"
- Click "New OAuth App"
- Set Homepage URL to: http://localhost:3000
- Set callback URL to: http://localhost:3000/api/auth/callback/github
- Add the given Client ID and secret to ...nextauth.ts or configure them as environment variables in
.env.local
-
npm run dev