Skip to main content
Version: Next

MultipleAnalyticsApi

Home > @backstage/core-app-api > MultipleAnalyticsApi

An implementation of the AnalyticsApi that can be used to forward analytics events to multiple concrete implementations.

Signature:

class MultipleAnalyticsApi implements AnalyticsApi 

Implements: AnalyticsApi

Example

createApiFactory({
api: analyticsApiRef,
deps: { configApi: configApiRef, identityApi: identityApiRef, storageApi: storageApiRef },
factory: ({ configApi, identityApi, storageApi }) =>
MultipleAnalyticsApi.fromApis([
VendorAnalyticsApi.fromConfig(configApi, { identityApi }),
CustomAnalyticsApi.fromConfig(configApi, { identityApi, storageApi }),
]),
});

Methods

Method

Modifiers

Description

captureEvent(event)

Forward the event to all configured analytics API implementations.

fromApis(actualApis)

static

Create an AnalyticsApi implementation from an array of concrete implementations.