sveltekit 2 SSR cookie set() and delete() requires path prop

I am experimenting with the sveltekit 2 upgrade with ssr (typescript). The only issue that came up was when creating the ServerClient we now have to pass the
path
prop in with the options. I just spread the options and added the path (see below). I am new to js/ts in general, so I wonder if there is a better way to do this, or if I am creating a foot-gun.

event.locals.supabase = createServerClient<Database>(PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY, {
  cookies: {
    get: (key) => event.cookies.get(key),
    set: (key, value, options) => {
      event.cookies.set(key, value, {...options, path: '/'});
    },
    remove: (key, options) => {
      event.cookies.delete(key, {...options, path: '/'});
    }
  }
});
Was this page helpful?