JavaScript SDK - use method
This method attaches a plugin (such as Assist, Redux or GraphQL) to the tracker and returns the plugin’s result, for example the middleware you wire into your store.
Signature
Section titled Signatureuse<T>(plugin: (app: App | null, options?: Partial<Options>) => T): T
Parameters
Section titled Parametersplugin: The plugin function, usually created by calling the plugin package’s default export.
Return value
Section titled Return valueReturns whatever the plugin returns. Call it after configure() (or after creating the class instance): before that, and on the server, the tracker singleton passes null to the plugin, which then returns an inert version that records nothing.
Example
Section titled Exampleimport { tracker } from '@openreplay/tracker'
import trackerAssist from '@openreplay/tracker-assist'
tracker.configure({ projectKey: PROJECT_KEY })
tracker.use(trackerAssist())