initial commit: rocket.new export of broadcastbeat

This commit is contained in:
Ryan Salazar
2026-05-07 16:39:17 +00:00
commit 70aa1ad46e
302 changed files with 60710 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import { createBrowserClient } from '@supabase/ssr';
export function createClient() {
return createBrowserClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
{
db: { schema: process.env.NEXT_PUBLIC_SUPABASE_SCHEMA || 'bb' },
cookies: {
getAll() {
if (typeof document === 'undefined') return [];
return document.cookie.split(';').map((cookie) => {
const [name, ...rest] = cookie.trim().split('=');
return { name, value: decodeURIComponent(rest.join('=')) };
});
},
setAll(cookiesToSet: Array<{ name: string; value: string; options?: any }>) {
if (typeof document === 'undefined') return;
cookiesToSet.forEach(({ name, value, options }) => {
let cookieString = `${name}=${encodeURIComponent(value)}; Path=${options?.path || '/'}; Secure; SameSite=None`;
if (options?.maxAge) cookieString += `; max-age=${options.maxAge}`;
if (options?.domain) cookieString += `; domain=${options.domain}`;
if (options?.expires) cookieString += `; expires=${options.expires}`;
document.cookie = cookieString;
});
},
},
}
);
}