-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 315909a
Showing
6 changed files
with
416 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# 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 | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "next-auth-deta", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "tsc" | ||
}, | ||
"files": [ | ||
"README.md", | ||
"dist" | ||
], | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"next-auth": "^4.3.1", | ||
"typescript": "^4.6.2" | ||
}, | ||
"peerDependencies": { | ||
"deta": "^1.1.0", | ||
"next-auth": "^4.3.1" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.