Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Hook for maintaining active user sessions
useKeepSessionAlive
import { useKeepSessionAlive } from "@getpara/react-sdk";
function SessionManager() { const { keepSessionAlive, keepSessionAliveAsync, isPending } = useKeepSessionAlive(); const [lastRefresh, setLastRefresh] = useState<Date | null>(null); const handleKeepAlive = async () => { try { const success = await keepSessionAliveAsync(); if (success) { setLastRefresh(new Date()); console.log("Session extended successfully"); } } catch (err) { console.error("Session extension error:", err); } }; return ( <button onClick={handleKeepAlive} disabled={isPending} > {isPending ? "Extending..." : "Extend Session"} </button> ); }