Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"docs:json": "typedoc --json docs/spec.json --mode modules --includeDeclarations --excludeExternals"
},
"dependencies": {
"@supabase/gotrue-js": "^1.17.0",
"@supabase/gotrue-js": "^1.17.1",
"@supabase/postgrest-js": "^0.33.3",
"@supabase/realtime-js": "^1.1.3",
"@supabase/storage-js": "^1.4.0"
Expand Down
1 change: 0 additions & 1 deletion src/SupabaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const DEFAULT_OPTIONS = {
autoRefreshToken: true,
persistSession: true,
detectSessionInUrl: true,
localStorage: globalThis.localStorage,
headers: DEFAULT_HEADERS,
}

Expand Down
10 changes: 2 additions & 8 deletions src/lib/SupabaseAuthClient.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import { GoTrueClient } from '@supabase/gotrue-js'
import { SupabaseAuthClientOptions } from './types'

export class SupabaseAuthClient extends GoTrueClient {
constructor(options: {
url?: string
headers?: { [key: string]: string }
detectSessionInUrl?: boolean
autoRefreshToken?: boolean
persistSession?: boolean
localStorage?: Storage
}) {
constructor(options: SupabaseAuthClientOptions) {
super(options)
}
}
7 changes: 6 additions & 1 deletion src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { GoTrueClient } from '@supabase/gotrue-js'
import { RealtimeClientOptions } from '@supabase/realtime-js'

type GoTrueClientOptions = ConstructorParameters<typeof GoTrueClient>[0]

export interface SupabaseAuthClientOptions extends GoTrueClientOptions {}

export type SupabaseClientOptions = {
/**
* The Postgres schema which your tables belong to. Must be on the list of exposed schemas in Supabase. Defaults to 'public'.
Expand All @@ -24,7 +29,7 @@ export type SupabaseClientOptions = {
/**
* A storage provider. Used to store the logged in session.
*/
localStorage?: Storage
localStorage?: SupabaseAuthClientOptions['localStorage']

/**
* Options passed to the realtime-js instance
Expand Down