Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
maggie-j-liu committed Mar 22, 2022
0 parents commit 315909a
Show file tree
Hide file tree
Showing 6 changed files with 416 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
38 changes: 38 additions & 0 deletions README.md
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
});
```
25 changes: 25 additions & 0 deletions package.json
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"
}
}
157 changes: 157 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 315909a

Please sign in to comment.