fix: imports

This commit is contained in:
Taesu
2025-10-30 21:06:48 +09:00
parent 2a15755f08
commit 68cb3fbc60

View File

@@ -27,6 +27,7 @@ npm install pg
And then you can use the following code to connect to your database. And then you can use the following code to connect to your database.
```ts title="auth.ts" ```ts title="auth.ts"
import { betterAuth } from 'better-auth';
import { Pool } from "pg"; import { Pool } from "pg";
export const auth = betterAuth({ export const auth = betterAuth({
@@ -43,7 +44,8 @@ export const auth = betterAuth({
Enable the email and password in your auth config. Enable the email and password in your auth config.
```ts title="auth.ts" ```ts title="auth.ts"
import { admin, anonymous } from "better-auth/plugins"; import { betterAuth } from 'better-auth';
import { Pool } from "pg";
export const auth = betterAuth({ export const auth = betterAuth({
database: new Pool({ database: new Pool({
@@ -68,7 +70,8 @@ export const auth = betterAuth({
Add all the social providers used in Supabase to the auth config. Missing any may cause user data loss during migration. Add all the social providers used in Supabase to the auth config. Missing any may cause user data loss during migration.
```ts title="auth.ts" ```ts title="auth.ts"
import { admin, anonymous } from "better-auth/plugins"; import { betterAuth } from 'better-auth';
import { Pool } from "pg";
export const auth = betterAuth({ export const auth = betterAuth({
database: new Pool({ database: new Pool({
@@ -93,7 +96,9 @@ export const auth = betterAuth({
Add the [admin](/docs/plugins/admin), [anonymous](/docs/plugins/anonymous) and [phoneNumber](/docs/plugins/phone-number) plugins to your auth config. To minimize data loss from Supabase Auth during migration, these plugins must be included in the auth config. Add the [admin](/docs/plugins/admin), [anonymous](/docs/plugins/anonymous) and [phoneNumber](/docs/plugins/phone-number) plugins to your auth config. To minimize data loss from Supabase Auth during migration, these plugins must be included in the auth config.
```ts title="auth.ts" ```ts title="auth.ts"
import { admin, anonymous } from "better-auth/plugins"; import { betterAuth } from 'better-auth';
import { Pool } from "pg";
import { admin, anonymous, phoneNumber } from 'better-auth/plugins';
export const auth = betterAuth({ export const auth = betterAuth({
database: new Pool({ database: new Pool({
@@ -119,7 +124,9 @@ export const auth = betterAuth({
To minimize data loss from Supabase Auth, the following additional fields are required. You can adjust them as needed after the migration is complete. To minimize data loss from Supabase Auth, the following additional fields are required. You can adjust them as needed after the migration is complete.
```ts title="auth.ts" ```ts title="auth.ts"
import { admin, anonymous } from "better-auth/plugins"; import { betterAuth } from 'better-auth';
import { Pool } from "pg";
import { admin, anonymous, phoneNumber } from 'better-auth/plugins';
export const auth = betterAuth({ export const auth = betterAuth({
database: new Pool({ database: new Pool({