Skip to content

Commit 06a7149

Browse files
feat: introduce @auth/supabase-adapter (#7807)
Database adapters are not dependent on Next.js features, so it makes sense to republish them under the `@auth/*` scope. This PR is part of a series to convert adapters, using `@auth/core` for types. If you are coming from the previous adapter, change your `package.json`: ```diff - "@next-auth/supabase-adapter": "0.0.0", + "@auth/supabase-adapter": "0.0.0", ``` And run `npm install`, `yarn install` or `pnpm install` respectively. **Note:** This packages is published as ESM-only
1 parent 662e094 commit 06a7149

File tree

13 files changed

+182
-178
lines changed

13 files changed

+182
-178
lines changed

.github/ISSUE_TEMPLATE/3_bug_adapter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ body:
3131
- "@auth/pouchdb-adapter"
3232
- "@auth/prisma-adapter"
3333
- "@auth/sequelize-adapter"
34-
- "@next-auth/supabase-adapter"
34+
- "@auth/supabase-adapter"
3535
- "@auth/typeorm-adapter"
3636
- "@auth/upstash-redis-adapter"
3737
- "@auth/xata-adapter"

.github/issue-labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ sequelize:
3131
- "@auth/sequelize-adapter"
3232

3333
supabase:
34-
- "@next-auth/supabase-adapter"
34+
- "@auth/supabase-adapter"
3535

3636
typeorm:
3737
- "@auth/typeorm-adapter"

apps/dev/nextjs-v4/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"dependencies": {
1717
"@auth/fauna-adapter": "workspace:*",
1818
"@auth/prisma-adapter": "workspace:*",
19-
"@next-auth/supabase-adapter": "workspace:*",
19+
"@auth/supabase-adapter": "workspace:*",
2020
"@auth/typeorm-adapter": "workspace:*",
2121
"@prisma/client": "^3",
2222
"@supabase/supabase-js": "^2.0.5",

apps/dev/nextjs-v4/pages/api/auth-old/[...nextauth].ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import WorkOS from "next-auth/providers/workos"
6060
// })
6161

6262
// // Supabase
63-
// import { SupabaseAdapter } from "@next-auth/supabase-adapter"
63+
// import { SupabaseAdapter } from "@auth/supabase-adapter"
6464
// const adapter = SupabaseAdapter({
6565
// url: process.env.NEXT_PUBLIC_SUPABASE_URL,
6666
// secret: process.env.SUPABASE_SERVICE_ROLE_KEY,

apps/dev/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@auth/core": "workspace:*",
1818
"@auth/fauna-adapter": "workspace:*",
1919
"@auth/prisma-adapter": "workspace:*",
20-
"@next-auth/supabase-adapter": "workspace:*",
20+
"@auth/supabase-adapter": "workspace:*",
2121
"@auth/typeorm-adapter": "workspace:*",
2222
"@prisma/client": "^3",
2323
"@supabase/supabase-js": "^2.0.5",

apps/dev/nextjs/pages/api/auth/[...nextauth].ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ import WorkOS from "@auth/core/providers/workos"
6464
// })
6565

6666
// // Supabase
67-
// import { SupabaseAdapter } from "@next-auth/supabase-adapter"
67+
// import { SupabaseAdapter } from "@auth/supabase-adapter"
6868
// const adapter = SupabaseAdapter({
6969
// url: process.env.NEXT_PUBLIC_SUPABASE_URL,
7070
// secret: process.env.SUPABASE_SERVICE_ROLE_KEY,

packages/adapter-supabase/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
</a>
99
<h3 align="center"><b>Supabase Adapter</b> - NextAuth.js / Auth.js</a></h3>
1010
<p align="center" style="align: center;">
11-
<a href="https://npm.im/@next-auth/supabase-adapter">
11+
<a href="https://npm.im/@auth/supabase-adapter">
1212
<img src="https://img.shields.io/badge/TypeScript-blue?style=flat-square" alt="TypeScript" />
1313
</a>
14-
<a href="https://npm.im/@next-auth/supabase-adapter">
15-
<img alt="npm" src="https://img.shields.io/npm/v/@next-auth/supabase-adapter?color=green&label=@next-auth/supabase-adapter&style=flat-square">
14+
<a href="https://npm.im/@auth/supabase-adapter">
15+
<img alt="npm" src="https://img.shields.io/npm/v/@auth/supabase-adapter?color=green&label=@auth/supabase-adapter&style=flat-square">
1616
</a>
17-
<a href="https://www.npmtrends.com/@next-auth/supabase-adapter">
18-
<img src="https://img.shields.io/npm/dm/@next-auth/supabase-adapter?label=%20downloads&style=flat-square" alt="Downloads" />
17+
<a href="https://www.npmtrends.com/@auth/supabase-adapter">
18+
<img src="https://img.shields.io/npm/dm/@auth/supabase-adapter?label=%20downloads&style=flat-square" alt="Downloads" />
1919
</a>
2020
<a href="https://github.com/nextauthjs/next-auth/stargazers">
2121
<img src="https://img.shields.io/github/stars/nextauthjs/next-auth?style=flat-square" alt="Github Stars" />

packages/adapter-supabase/package.json

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
{
2-
"name": "@next-auth/supabase-adapter",
3-
"version": "0.2.1",
4-
"description": "Supabase adapter for next-auth.",
2+
"name": "@auth/supabase-adapter",
3+
"version": "0.0.0",
4+
"description": "Supabase adapter for Auth.js",
55
"homepage": "https://authjs.dev",
66
"repository": "https://github.com/nextauthjs/next-auth",
77
"bugs": {
88
"url": "https://github.com/nextauthjs/next-auth/issues"
99
},
1010
"author": "Martin Sonnberger <[email protected]>",
11-
"main": "dist/index.js",
11+
"type": "module",
12+
"types": "./index.d.ts",
13+
"files": [
14+
"*.js",
15+
"*.d.ts*",
16+
"src"
17+
],
18+
"exports": {
19+
".": {
20+
"types": "./index.d.ts",
21+
"import": "./index.js"
22+
}
23+
},
1224
"keywords": [
1325
"next-auth",
1426
"next.js",
@@ -23,16 +35,17 @@
2335
"build": "tsc",
2436
"test": "./tests/test.sh"
2537
},
38+
"dependencies": {
39+
"@auth/core": "workspace:*"
40+
},
2641
"peerDependencies": {
27-
"@supabase/supabase-js": "^2.0.5",
28-
"next-auth": "^4.18.7"
42+
"@supabase/supabase-js": "^2.0.5"
2943
},
3044
"devDependencies": {
3145
"@next-auth/adapter-test": "workspace:^0.0.0",
3246
"@next-auth/tsconfig": "workspace:^0.0.0",
3347
"@supabase/supabase-js": "^2.0.5",
34-
"jest": "^27.4.3",
35-
"next-auth": "workspace:*"
48+
"jest": "^27.4.3"
3649
},
3750
"jest": {
3851
"preset": "@next-auth/adapter-test/jest"

packages/adapter-supabase/src/database.types.ts

Lines changed: 0 additions & 139 deletions
This file was deleted.

0 commit comments

Comments
 (0)