Skip to main content

initServiceRegistry

Initializes the service registry with core strategies for different communication methods. This function sets up the registry that manages wallet service strategies and should be called once during FCL initialization with platform-specific core strategies.

Import

You can import the entire package and access the function:


_10
import * as fcl from "@onflow/fcl-core"
_10
_10
fcl.initServiceRegistry(options)

Or import directly the specific function:


_10
import { initServiceRegistry } from "@onflow/fcl-core"
_10
_10
initServiceRegistry(options)

Usage


_10
// Initialize service registry with core strategies
_10
const registry = initServiceRegistry({
_10
coreStrategies: {
_10
"HTTP/POST": httpPostStrategy,
_10
"IFRAME/RPC": iframeRpcStrategy,
_10
"POP/RPC": popupRpcStrategy
_10
}
_10
})

Parameters

options

  • Type:

_10
{ coreStrategies: any; }

Returns


_10
Readonly<{ add: (servicePlugin: any) => void; getServices: () => any[]; getStrategy: (method: any) => unknown; getStrategies: () => any[]; }>

The initialized service registry instance


Rate this page