Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 968 Bytes

README.md

File metadata and controls

38 lines (28 loc) · 968 Bytes

Deta Adapter - NextAuth.js

This is a Deta adapter for next-auth.

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
  1. 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.
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
});