Module

x/live/deps.ts>supabase.GoTrueClient#startAutoRefresh

Open-Source web editor based on Preact, Tailwind and TypeScript. The other side of code.
Go to Latest
method supabase.GoTrueClient.prototype.startAutoRefresh
import { supabase } from "https://dotland.deno.dev/x/live@1.63.12/deps.ts";
const { GoTrueClient } = supabase;

Starts an auto-refresh process in the background. The session is checked every few seconds. Close to the time of expiration a process is started to refresh the session. If refreshing fails it will be retried for as long as necessary.

If you set the {@link GoTrueClientOptions#autoRefreshToken} you don't need to call this function, it will be called for you.

On browsers the refresh process works only when the tab/window is in the foreground to conserve resources as well as prevent race conditions and flooding auth with requests. If you call this method any managed visibility change callback will be removed and you must manage visibility changes on your own.

On non-browser platforms the refresh process works continuously in the background, which may not be desirable. You should hook into your platform's foreground indication mechanism and call these methods appropriately to conserve resources.

{@see #stopAutoRefresh}

Returns

Promise<void>