Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maggie-j-liu/next-auth-deta
A Deta adapter for NextAuth.js
https://github.com/maggie-j-liu/next-auth-deta
deta deta-base next-auth nextauthjs nextjs
Last synced: 2 months ago
JSON representation
A Deta adapter for NextAuth.js
- Host: GitHub
- URL: https://github.com/maggie-j-liu/next-auth-deta
- Owner: maggie-j-liu
- Created: 2022-03-22T19:39:33.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-23T15:46:48.000Z (over 2 years ago)
- Last Synced: 2024-10-11T11:58:57.279Z (3 months ago)
- Topics: deta, deta-base, next-auth, nextauthjs, nextjs
- Language: TypeScript
- Homepage:
- Size: 10.7 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Deta Adapter - NextAuth.js
This is a [Deta](https://deta.sh) adapter for [`next-auth`](https://next-auth.js.org/).
## Getting Started
1. Install this package, `next-auth-deta`, as well as `next-auth` and `deta`.
```
# npm
npm install next-auth-deta next-auth deta# yarn
yarn add next-auth-deta next-auth deta# pnpm
pnpm add next-auth-deta next-auth deta
```2. Add the adapter to your next-auth config in `pages/api/auth/[...nextauth].js`. Add your `DETA_PROJECT_KEY` as an environment variable, then create a deta instance and pass it to the `DetaAdapter`.
```js
import NextAuth from "next-auth";
import GithubProvider from "next-auth/providers/github";
import { DetaAdapter } from "next-auth-deta";
import { Deta } from "deta";const deta = Deta(process.env.DETA_PROJECT_KEY);
export default NextAuth({
adapter: DetaAdapter(deta),
providers: [
// add your providers here
// https://next-auth.js.org/providers
],
// more options
});
```