diff --git a/src/ambient.d.ts b/src/ambient.d.ts deleted file mode 100644 index 1c305ad..0000000 --- a/src/ambient.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// these variables are defined by tsup -declare const PACKAGE_NAME: string; -declare const PACKAGE_VERSION: string; diff --git a/src/createBrowserClient.ts b/src/createBrowserClient.ts index 7abd87b..94d80bc 100644 --- a/src/createBrowserClient.ts +++ b/src/createBrowserClient.ts @@ -1,12 +1,5 @@ import { createClient } from "@supabase/supabase-js"; import { mergeDeepRight } from "ramda"; -import { - DEFAULT_COOKIE_OPTIONS, - combineChunks, - createChunks, - deleteChunks, - isBrowser, -} from "./utils"; import { parse, serialize } from "cookie"; import type { SupabaseClient } from "@supabase/supabase-js"; @@ -14,6 +7,15 @@ import type { GenericSchema, SupabaseClientOptions, } from "@supabase/supabase-js/dist/module/lib/types"; + +import { VERSION } from "./version"; +import { + DEFAULT_COOKIE_OPTIONS, + combineChunks, + createChunks, + deleteChunks, + isBrowser, +} from "./utils"; import type { CookieMethods, CookieOptionsWithName } from "./types"; let cachedBrowserClient: SupabaseClient | undefined; @@ -98,7 +100,7 @@ export function createBrowserClient< const cookieClientOptions = { global: { headers: { - "X-Client-Info": `${PACKAGE_NAME}/${PACKAGE_VERSION}`, + "X-Client-Info": `supabase-ssr/${VERSION}`, }, }, auth: { diff --git a/src/createServerClient.ts b/src/createServerClient.ts index 27e0033..7685f03 100644 --- a/src/createServerClient.ts +++ b/src/createServerClient.ts @@ -12,6 +12,8 @@ import type { GenericSchema, SupabaseClientOptions, } from "@supabase/supabase-js/dist/module/lib/types"; + +import { VERSION } from "./version"; import type { CookieOptionsWithName, CookieMethods } from "./types"; export function createServerClient< @@ -69,7 +71,7 @@ export function createServerClient< const cookieClientOptions = { global: { headers: { - "X-Client-Info": `${PACKAGE_NAME}/${PACKAGE_VERSION}`, + "X-Client-Info": `supabase-ssr/${VERSION}`, }, }, auth: { diff --git a/src/version.ts b/src/version.ts new file mode 100644 index 0000000..387b59e --- /dev/null +++ b/src/version.ts @@ -0,0 +1 @@ +export const VERSION = "0.3.0";