New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@supabase/auth-helpers-sveltekit

Package Overview
Dependencies
Maintainers
5
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@supabase/auth-helpers-sveltekit - npm Package Compare versions

Comparing version

to
0.10.0

69

./dist/index.js

@@ -40,24 +40,17 @@ // src/supabaseLoadClient.ts

}
const client = createSupabaseClient(
supabaseUrl,
supabaseKey,
{
...options,
global: {
fetch: event.fetch,
...options == null ? void 0 : options.global,
headers: {
...(_a = options == null ? void 0 : options.global) == null ? void 0 : _a.headers,
"X-Client-Info": `${"@supabase/auth-helpers-sveltekit"}@${"0.10.0-next.3"}`
}
},
auth: {
storageKey: cookieOptions == null ? void 0 : cookieOptions.name,
storage: new SvelteKitLoadAuthStorageAdapter(
serverSession,
cookieOptions
)
const client = createSupabaseClient(supabaseUrl, supabaseKey, {
...options,
global: {
fetch: event.fetch,
...options == null ? void 0 : options.global,
headers: {
...(_a = options == null ? void 0 : options.global) == null ? void 0 : _a.headers,
"X-Client-Info": `${"@supabase/auth-helpers-sveltekit"}@${"0.10.0"}`
}
},
auth: {
storageKey: cookieOptions == null ? void 0 : cookieOptions.name,
storage: new SvelteKitLoadAuthStorageAdapter(serverSession, cookieOptions)
}
);
});
if (browser) {

@@ -75,5 +68,3 @@ cachedBrowserClient = client;

// src/serverStorageAdapter.ts
import {
CookieAuthStorageAdapter
} from "@supabase/auth-helpers-shared";
import { CookieAuthStorageAdapter } from "@supabase/auth-helpers-shared";
var SvelteKitServerAuthStorageAdapter = class extends CookieAuthStorageAdapter {

@@ -138,24 +129,16 @@ constructor(event, cookieOptions, expiryMargin = 60) {

var _a;
const client = createSupabaseClient2(
supabaseUrl,
supabaseKey,
{
...options,
global: {
...options == null ? void 0 : options.global,
headers: {
...(_a = options == null ? void 0 : options.global) == null ? void 0 : _a.headers,
"X-Client-Info": `${"@supabase/auth-helpers-sveltekit"}@${"0.10.0-next.3"}`
}
},
auth: {
storageKey: cookieOptions == null ? void 0 : cookieOptions.name,
storage: new SvelteKitServerAuthStorageAdapter(
event,
cookieOptions,
expiryMargin
)
const client = createSupabaseClient2(supabaseUrl, supabaseKey, {
...options,
global: {
...options == null ? void 0 : options.global,
headers: {
...(_a = options == null ? void 0 : options.global) == null ? void 0 : _a.headers,
"X-Client-Info": `${"@supabase/auth-helpers-sveltekit"}@${"0.10.0"}`
}
},
auth: {
storageKey: cookieOptions == null ? void 0 : cookieOptions.name,
storage: new SvelteKitServerAuthStorageAdapter(event, cookieOptions, expiryMargin)
}
);
});
return client;

@@ -162,0 +145,0 @@ }

import { SupabaseClientOptionsWithoutAuth, CookieOptionsWithName } from '@supabase/auth-helpers-shared';
import * as _supabase_supabase_js from '@supabase/supabase-js';
import { Session, SupabaseClient } from '@supabase/supabase-js';
import { LoadEvent, RequestEvent } from '@sveltejs/kit';
import { GenericSchema } from '@supabase/supabase-js/dist/module/lib/types';

@@ -44,3 +44,3 @@ /**

*/
declare function createSupabaseLoadClient<Database = any, SchemaName extends string & keyof Database = 'public' extends keyof Database ? 'public' : string & keyof Database>({ supabaseUrl, supabaseKey, event, serverSession, options, cookieOptions }: {
declare function createSupabaseLoadClient<Database = any, SchemaName extends string & keyof Database = 'public' extends keyof Database ? 'public' : string & keyof Database, Schema extends GenericSchema = Database[SchemaName] extends GenericSchema ? Database[SchemaName] : any>({ supabaseUrl, supabaseKey, event, serverSession, options, cookieOptions }: {
supabaseUrl: string;

@@ -58,3 +58,3 @@ /**

cookieOptions?: CookieOptionsWithName;
}): SupabaseClient<Database, SchemaName>;
}): SupabaseClient<Database, SchemaName, Schema>;

@@ -112,3 +112,3 @@ /**

*/
declare function createSupabaseServerClient<Database = any, SchemaName extends string & keyof Database = 'public' extends keyof Database ? 'public' : string & keyof Database>({ supabaseUrl, supabaseKey, event, options, cookieOptions, expiryMargin }: {
declare function createSupabaseServerClient<Database = any, SchemaName extends string & keyof Database = 'public' extends keyof Database ? 'public' : string & keyof Database, Schema extends GenericSchema = Database[SchemaName] extends GenericSchema ? Database[SchemaName] : any>({ supabaseUrl, supabaseKey, event, options, cookieOptions, expiryMargin }: {
supabaseUrl: string;

@@ -120,4 +120,4 @@ supabaseKey: string;

expiryMargin?: number;
}): _supabase_supabase_js.SupabaseClient<any, SchemaName, any>;
}): SupabaseClient<Database, SchemaName, Schema>;
export { createSupabaseLoadClient, createSupabaseServerClient };

@@ -40,24 +40,17 @@ // src/supabaseLoadClient.ts

}
const client = createSupabaseClient(
supabaseUrl,
supabaseKey,
{
...options,
global: {
fetch: event.fetch,
...options == null ? void 0 : options.global,
headers: {
...(_a = options == null ? void 0 : options.global) == null ? void 0 : _a.headers,
"X-Client-Info": `${"@supabase/auth-helpers-sveltekit"}@${"0.10.0-next.3"}`
}
},
auth: {
storageKey: cookieOptions == null ? void 0 : cookieOptions.name,
storage: new SvelteKitLoadAuthStorageAdapter(
serverSession,
cookieOptions
)
const client = createSupabaseClient(supabaseUrl, supabaseKey, {
...options,
global: {
fetch: event.fetch,
...options == null ? void 0 : options.global,
headers: {
...(_a = options == null ? void 0 : options.global) == null ? void 0 : _a.headers,
"X-Client-Info": `${"@supabase/auth-helpers-sveltekit"}@${"0.10.0"}`
}
},
auth: {
storageKey: cookieOptions == null ? void 0 : cookieOptions.name,
storage: new SvelteKitLoadAuthStorageAdapter(serverSession, cookieOptions)
}
);
});
if (browser) {

@@ -75,5 +68,3 @@ cachedBrowserClient = client;

// src/serverStorageAdapter.ts
import {
CookieAuthStorageAdapter
} from "@supabase/auth-helpers-shared";
import { CookieAuthStorageAdapter } from "@supabase/auth-helpers-shared";
var SvelteKitServerAuthStorageAdapter = class extends CookieAuthStorageAdapter {

@@ -138,24 +129,16 @@ constructor(event, cookieOptions, expiryMargin = 60) {

var _a;
const client = createSupabaseClient2(
supabaseUrl,
supabaseKey,
{
...options,
global: {
...options == null ? void 0 : options.global,
headers: {
...(_a = options == null ? void 0 : options.global) == null ? void 0 : _a.headers,
"X-Client-Info": `${"@supabase/auth-helpers-sveltekit"}@${"0.10.0-next.3"}`
}
},
auth: {
storageKey: cookieOptions == null ? void 0 : cookieOptions.name,
storage: new SvelteKitServerAuthStorageAdapter(
event,
cookieOptions,
expiryMargin
)
const client = createSupabaseClient2(supabaseUrl, supabaseKey, {
...options,
global: {
...options == null ? void 0 : options.global,
headers: {
...(_a = options == null ? void 0 : options.global) == null ? void 0 : _a.headers,
"X-Client-Info": `${"@supabase/auth-helpers-sveltekit"}@${"0.10.0"}`
}
},
auth: {
storageKey: cookieOptions == null ? void 0 : cookieOptions.name,
storage: new SvelteKitServerAuthStorageAdapter(event, cookieOptions, expiryMargin)
}
);
});
return client;

@@ -162,0 +145,0 @@ }

{
"name": "@supabase/auth-helpers-sveltekit",
"version": "0.10.0-next.3",
"version": "0.10.0",
"description": "A collection of framework specific Auth utilities for working with Supabase.",

@@ -47,3 +47,3 @@ "type": "module",

"dependencies": {
"@supabase/auth-helpers-shared": "0.4.0-next.3"
"@supabase/auth-helpers-shared": "0.4.0"
},

@@ -55,2 +55,3 @@ "peerDependencies": {

"scripts": {
"lint": "tsc",
"build": "tsup",

@@ -57,0 +58,0 @@ "clean:all": "rimraf dist node_modules"

@@ -35,6 +35,3 @@ # @supabase/auth-helpers-sveltekit (BETA)

// src/hooks.server.ts
import {
PUBLIC_SUPABASE_URL,
PUBLIC_SUPABASE_ANON_KEY
} from '$env/static/public';
import { PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY } from '$env/static/public';
import { createSupabaseServerClient } from '@supabase/auth-helpers-sveltekit';

@@ -98,6 +95,3 @@ import type { Handle } from '@sveltejs/kit';

// src/routes/+layout.ts
import {
PUBLIC_SUPABASE_ANON_KEY,
PUBLIC_SUPABASE_URL
} from '$env/static/public';
import { PUBLIC_SUPABASE_ANON_KEY, PUBLIC_SUPABASE_URL } from '$env/static/public';
import { createSupabaseLoadClient } from '@supabase/auth-helpers-sveltekit';

@@ -214,4 +208,4 @@ import type { LayoutLoad } from './$types';

{#if session}
<p>client-side data fetching with RLS</p>
<pre>{JSON.stringify(loadedData, null, 2)}</pre>
<p>client-side data fetching with RLS</p>
<pre>{JSON.stringify(loadedData, null, 2)}</pre>
{/if}

@@ -264,5 +258,3 @@ ```

export const GET: RequestHandler = async ({
locals: { supabase, getSession }
}) => {
export const GET: RequestHandler = async ({ locals: { supabase, getSession } }) => {
const session = await getSession();

@@ -388,6 +380,3 @@ if (!session) {

// protect POST requests to all routes that start with /protected-posts
if (
event.url.pathname.startsWith('/protected-posts') &&
event.request.method === 'POST'
) {
if (event.url.pathname.startsWith('/protected-posts') && event.request.method === 'POST') {
const session = await event.locals.getSession();

@@ -394,0 +383,0 @@ if (!session) {

Sorry, the diff of this file is not supported yet