v0.26.0
@kitcn/resend
Published @kitcn/resend@0.26.0.
kitcn
Minor Changes
-
#401
947cd11Thanks @MikeyZhang75! - ## Breaking changes- Require
apionconvexBetterAuthReactStart, which now returnscreateCaller
andcreateContextalongside the auth helpers.
// Before export const { handler, getToken } = convexBetterAuthReactStart({ convexUrl: import.meta.env.VITE_CONVEX_URL!, convexSiteUrl: import.meta.env.VITE_CONVEX_SITE_URL!, }); // After export const { handler, getToken, createCaller, createContext } = convexBetterAuthReactStart({ api, convexUrl: import.meta.env.VITE_CONVEX_URL!, convexSiteUrl: import.meta.env.VITE_CONVEX_SITE_URL!, });
- Drop
runServerCallfrom the TanStack Start scaffold. Call procedures on a
caller bound once withcreateCaller().
// Before export function runServerCall<T>( fn: (caller: ServerCaller) => Promise<T> | T ) { const caller = createServerCaller(); return fn(caller); } await runServerCall((caller) => caller.user.getSessionUser({})); // After export const caller = createCaller(); await caller.user.getSessionUser({});
- Move TanStack Start JWT caching under
auth.jwtCache, a boolean.
// Before convexBetterAuthReactStart({ jwtCache: { enabled: true, isAuthError }, // ... }); // After convexBetterAuthReactStart({ auth: { jwtCache: true, isUnauthorized: isAuthError }, // ... });
Patches
- Fetch the Convex auth token once per request on TanStack Start. Every
procedure call,getToken(), andfetchAuthQuery/fetchAuthMutation/
fetchAuthActionin a request now share one token, instead of each paying its
own round trip. - Stop replaying a rejected auth token for the rest of a request. After a
refresh, the remaining calls sharing that context use the new token instead of
re-failing and re-running non-idempotent mutations and actions. - Refresh expired TanStack Start tokens instead of failing. Forced refresh and
token freshness now reach the token layer, so a stale token retries once and a
fresh one is no longer replayed on an authorization error.
Existing TanStack Start apps: re-run
kitcn add auth --overwriteto update
src/lib/convex/auth-server.tsandsrc/lib/convex/server.ts. - Require