Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.getpara.com/llms.txt

Use this file to discover all available pages before exploring further.

The useKeepSessionAlive hook extends the current session. Call it periodically when the user is active to prevent automatic session expiry.

Import

import { useKeepSessionAlive } from "@getpara/react-native-wallet";

Usage

import { useKeepSessionAlive } from "@getpara/react-native-wallet";
import { useEffect } from "react";

function SessionKeepAlive() {
  const { keepSessionAliveAsync } = useKeepSessionAlive();

  useEffect(() => {
    const interval = setInterval(() => {
      keepSessionAliveAsync().catch(console.error);
    }, 5 * 60 * 1000); // every 5 minutes

    return () => clearInterval(interval);
  }, [keepSessionAliveAsync]);

  return null;
}