MCPcopy
hub / github.com/cursor/community-plugins / createClient

Function createClient

apps/cursor/src/utils/supabase/server.ts:12–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10 * cookie-based session auth.
11 */
12export async function createClient() {
13 const cookieStore = await cookies();
14
15 return createServerClient(
16 process.env.NEXT_PUBLIC_SUPABASE_URL!,
17 process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY!,
18 {
19 cookies: {
20 getAll() {
21 return cookieStore.getAll();
22 },
23 setAll(cookiesToSet) {
24 try {
25 for (const { name, value, options } of cookiesToSet) {
26 cookieStore.set(name, value, options);
27 }
28 } catch {
29 // The `setAll` method was called from a Server Component.
30 // This can be ignored if you have middleware refreshing
31 // user sessions.
32 }
33 },
34 },
35 },
36 );
37}

Callers 11

update-settings.tsFile · 0.90
edit-profile.tsFile · 0.90
delete-plugin.tsFile · 0.90
star-plugin.tsFile · 0.90
upsert-company.tsFile · 0.90
getSessionFunction · 0.90
GETFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected