Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

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

Git-based Visual CMS for Deno, </> htmx and Tailwind apps. Deploy on any Deno-compatible host.
Latest
method supabase.GoTrueClient.prototype.startAutoRefresh
Re-export
import { supabase } from "https://deno.land/x/live@1.74.1/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 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>