Skip to main content

PWA API

Last updated 10/04/2026

Five Offline API (PWA) Overview​

Five provides a set of client-side offline APIs available on the

object, designed for use within Progessive Web Applications (PWAs). These functions allow applications to store, retrieve, and manage data locally using IndexedDB, allowing the application to continue operating even when offline.

All functions are executed in the browser (PWA/ custom action context) and are not available on the backend. They provide the core building blocks for offline-first behavior in Five applications, including table initialization, record and dataset storage, data retrieval, deletion, and online status monitoring.

Together, these APIs allow Five applications to maintain functionality without connectivity and seamlessly synchronize once the user is back online.

Offline API Functions​

initializeRequiredTables()​

The

initializeRequiredTables()
is a function on the
Five
object that sets up the required IndexedDB tables for offline storage when the application starts, ensuring the local data structure is ready before any offline data operations are performed.

Function Signature
initializeRequiredTables(tables: Array<string>, done: () => void): any;

saveTableOffline()​

The

saveTableOffline()
is a function on the
Five
object that stores an entire array of records into a specified IndexedDB table, allowing bulk data to be cached locally for offline use.

Function Signature
saveTableOffline(tableName: string, data: Array<any>) : void;

getTableOffline()​

The

getTableOffline()
is a function on the
Five
object that retrieves all records from a specified IndexedDB table and returns them through a callback, allowing the application to access locally stored data when offline.

Function Signature
getTableOffline(tableName: string, callback: (data: Array<any>) => void, errorCallback?: (err: any) => void) : void;

saveRecordOffline()​

The

saveRecordOffline()
is a function on the
Five
object that saves or updates a single record in an IndexedDB table using a unique key, allowing individual data entries to be stored locally for offline use.

Function Signature
saveRecordOffline(tableName: string, key: string, data: Object, onSaved?: () => void, errorCallback?: (err: any) => void) : void;

getRecordOffline()​

The

getRecordOffline()
is a function on the
Five
object that retrieves a single record from an IndexedDB table using its unique key and returns it through a callback, allowing the application to access individual locally stored records when offline.

Function Signature
getRecordOffline(tableName: string, key:string, callback: (data: any[]) => void, errorCallback?: (err: any) => void):void;

deleteRecordOffline()​

The

deleteRecordOffline()
is a function on the
Five
object that removes a specific record from an IndexedDB table using its unique key, allowing locally stored data to be deleted when it is no longer needed.

Function Signature
deleteRecordOffline(tableName: string, key: string, onDeleted?: () => void, errorCallback?: (err: any) => void) : void;

registerOnlineStatusCallback()​

The

registerOnlineStatusCallback()
is a function on the
Five
object that registers a listener to monitor changes in network connectivity and triggers a callback whenever the application goes online or offline.

Function Signature
registerOnlineStatusCallback(callback: (online: boolean) => void): () => void;