|
1 | | -import { createClient, SupabaseClient } from "@supabase/supabase-js"; |
| 1 | +import { |
| 2 | + AuthChangeEvent, |
| 3 | + createClient, |
| 4 | + SupabaseClient, |
| 5 | +} from "@supabase/supabase-js"; |
2 | 6 | import type { |
3 | 7 | GenericSchema, |
4 | 8 | SupabaseClientOptions, |
5 | 9 | } from "@supabase/supabase-js/dist/module/lib/types"; |
6 | 10 |
|
7 | 11 | import { VERSION } from "./version"; |
8 | | -import { |
9 | | - DEFAULT_COOKIE_OPTIONS, |
10 | | - combineChunks, |
11 | | - createChunks, |
12 | | - deleteChunks, |
13 | | - isBrowser, |
14 | | - isChunkLike, |
15 | | -} from "./utils"; |
16 | 12 | import { createStorageFromOptions, applyServerStorage } from "./cookies"; |
17 | 13 | import type { |
18 | 14 | CookieOptionsWithName, |
@@ -75,7 +71,7 @@ export function createServerClient< |
75 | 71 | * **Use in pages, components or routes.** |
76 | 72 | * |
77 | 73 | * To use Supabase features server-side rendered in pages, components or routes |
78 | | - * (a.k.a. actions / APIs) you must create a client with this funciton. Not all |
| 74 | + * (a.k.a. actions / APIs) you must create a client with this function. Not all |
79 | 75 | * frameworks allow the ability to set cookies or response headers when pages |
80 | 76 | * or components are rendered. In those cases you _can omit `setAll` (or the |
81 | 77 | * deprecated `set`, `remove`) cookie option methods_. **It is strongly |
@@ -180,7 +176,7 @@ export function createServerClient< |
180 | 176 | }, |
181 | 177 | ); |
182 | 178 |
|
183 | | - client.auth.onAuthStateChange(async (event) => { |
| 179 | + client.auth.onAuthStateChange(async (event: AuthChangeEvent) => { |
184 | 180 | // The SIGNED_IN event is fired very often, but we don't need to |
185 | 181 | // apply the storage each time it fires, only if there are changes |
186 | 182 | // that need to be set -- which is if setItems / removeItems have |
|
0 commit comments