SolidJSS
SolidJS2y ago
24 replies
DaOfficialWizard🧙

Assistance with SolidStart and Supabase Auth in SSR

I am currently trying to piece together exactly how to setup SolidStart with the
@supabase/ssr
package.

The Supabase package expects:
import { createBrowserClient, createServerClient, type CookieOptions } from '@supabase/ssr'

export function createSupabaseFrontendClient() {
    return createBrowserClient(
        import.meta.env.VITE_SUPABASE_URL,
        import.meta.env.VITE_SUPABASE_ANON_KEY,
    )
}

export function createSupabaseBackendClient() {
    return createServerClient(
        import.meta.env.VITE_SUPABASE_URL,
        import.meta.env.VITE_SUPABASE_SERVICE_KEY,
        {
            cookies: {
                get: (
                    key: string,
                ): Promise<string | null | undefined> | string | null | undefined => {
                    // get the cookie value from the request
                },
                set: (key: string, value: string, options: CookieOptions): Promise<void> | void => {
                    // set the cookie value in the response
                },
                remove: (key: string, options: CookieOptions): Promise<void> | void => {
                    // remove the cookie from the session
                },
            },
        },
    )
}


However, I am a little lost on how to setup this up with vinxi/http.
Was this page helpful?