MCPcopy Create free account
hub / github.com/Alphanimble/htmlstream / saveServerSession

Function saveServerSession

demo/chat/session.ts:104–114  ·  view source on GitHub ↗
(session: ChatSession)

Source from the content-addressed store, hash-verified

102}
103
104export async function saveServerSession(session: ChatSession): Promise<void> {
105 try {
106 await fetch("/api/session", {
107 method: "POST",
108 headers: { "Content-Type": "application/json" },
109 body: JSON.stringify(session),
110 });
111 } catch {
112 // localStorage is the primary store; disk log is best-effort
113 }
114}
115
116export function clearLocalSession(): void {
117 localStorage.removeItem(STORAGE_KEY);

Callers 1

ChatAppFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected