Skip to main content

Overview

Using the FlureeWorker library, a browser service worker can create a local query peer within the browser, making trusted data readily available.

Messages are used communicate between the FlureeWorker and the originating application. Message data to/from the FlureeWorker are expected in the following format:

NameDescription
actionthe action to be performed (e.g., login)
connthe connection ID
refthe reference ID to include in the response
paramsparameters for the action

Messages to FlureeWorker

The following messages, or events, are recognized by FlureeWorker.

MessageActionExplanation
ConnectconnectInitiate a connection with a Fluree instance
Close ConnectioncloseClose a connection to a Fluree instance
Log into Fluree LedgerloginAuthenticate with ledger via username and password
Reqister QueryregisterQueryRegister a FlureeQL with a connection
Reset ConnectionresetReset a connection to a Fluree instance
Unregister QueryunregisterQueryDe-register/remove a FlureeQL from a connection

Messages from FlureeWorker

The following messages, or events, may be received from the FlureeWorker.

MessageActionExplanation
Worker InitializedconnInitWorker ready. FlureeWorker service worker is initialized and available for connections
Connection ClosedconnClosedResult of close request
Connection StatusconnStatusResult of connect request
LoginloginResult of login request
Set StatesetStateState has changed for a reference, generally triggered by one or more registerQuery actions
Connection ResetconnResetResult of reset request