Files
archived-next-auth/packages/adapter-supabase/README.md
Martin Sonnberger dac490b7a1 feat(adapters): Add Supabase adapter (#5050)
* Add Supabase adapter

* Add Supabase adapter

* Add schema setup to docs

* supabase config changes

* chore: update to supabase-js v2.

* chore: migrate to next_auth schema.

* feat: add supabase examples.

* chore: update docs.

* chore: add telemetry.

* fix: resolve issues after merge.

* chore: extend session type.

* typo

* chore: remove unnecessary grants.

* fix: schema constraints.

Co-authored-by: thorwebdev <thor@supabase.io>
Co-authored-by: Thor 雷神 Schaeff <5748289+thorwebdev@users.noreply.github.com>
Co-authored-by: Thang Vu <hi@thvu.dev>
2022-11-19 20:56:20 +07:00

2.0 KiB


Supabase Adapter - NextAuth.js

Open Source. Full Stack. Own Your Data.

Build Test Bundle Size @next-auth/supabase-adapter Version

Overview

This is the Supabase Adapter for next-auth. This package can only be used in conjunction with the primary next-auth package. It is not a standalone package.

You can find more Supabase information in the docs at next-auth.js.org/adapters/supabase.

Getting Started

  1. Install @supabase/supabase-js, next-auth and @next-auth/supabase-adapter.
npm install @supabase/supabase-js next-auth @next-auth/supabase-adapter
  1. Add this adapter to your pages/api/[...nextauth].js next-auth configuration object.
import NextAuth from "next-auth"
import { SupabaseAdapter } from "@next-auth/supabase-adapter"

// For more information on each option (and a full list of options) go to
// https://next-auth.js.org/configuration/options
export default NextAuth({
  // https://next-auth.js.org/configuration/providers
  providers: [
    // ...
  ],
  adapter: SupabaseAdapter({
    url: process.env.NEXT_PUBLIC_SUPABASE_URL,
    secret: process.env.SUPABASE_SERVICE_ROLE_KEY,
  }),
  // ...
})

Contributing

We're open to all community contributions! If you'd like to contribute in any way, please read our Contributing Guide.

License

ISC