import { clearSession, useSession, type SessionConfig } from "@tanstack/react-start/server"; export interface AppSessionData { did?: string; } const SESSION_CONFIG: SessionConfig = { password: process.env["SESSION_PASSWORD"] ?? "OMG-SET-YOUR-ENV-4-SAFETY!!!!!!!!!" } export function useAppSession() { return useSession(SESSION_CONFIG); } export async function updateAppSession(did: string) { const session = await useAppSession(); await session.update({ did }); } export async function clearAppSession() { await clearSession(SESSION_CONFIG); }