Hello! I just updated to Better Auth v1.3 to try out the new SvelteKit cookies plugin, I'm using the code on the changelog but I'm getting this problem on getRequestEvent in VS Code:
Argument of type '() => RequestEvent<Partial<Record<string, string>>, string | null>' is not assignable to parameter of type '() => Promise<RequestEvent<Partial<Record<string, string>>, string | null>>'. Type 'RequestEvent<Partial<Record<string, string>>, string | null>' is missing the following properties from type 'Promise<RequestEvent<Partial<Record<string, string>>, string | null>>': then, catch, finally, [Symbol.toStringTag]ts(2345)
Argument of type '() => RequestEvent<Partial<Record<string, string>>, string | null>' is not assignable to parameter of type '() => Promise<RequestEvent<Partial<Record<string, string>>, string | null>>'. Type 'RequestEvent<Partial<Record<string, string>>, string | null>' is missing the following properties from type 'Promise<RequestEvent<Partial<Record<string, string>>, string | null>>': then, catch, finally, [Symbol.toStringTag]ts(2345)
Here's the code:
import { betterAuth } from 'better-auth';import { twoFactor } from 'better-auth/plugins';import { sveltekitCookies } from 'better-auth/svelte-kit';import { getRequestEvent } from "$app/server";export const auth = betterAuth({ plugins: [twoFactor(), sveltekitCookies(getRequestEvent)],...
import { betterAuth } from 'better-auth';import { twoFactor } from 'better-auth/plugins';import { sveltekitCookies } from 'better-auth/svelte-kit';import { getRequestEvent } from "$app/server";export const auth = betterAuth({ plugins: [twoFactor(), sveltekitCookies(getRequestEvent)],...
It looks like it's working correctly so it may just be cosmetic. Thank you!