interface CommonProvider<S> {
    events?: ProviderEventEmitter<AnyProviderEvent, Record<string, unknown>>;
    metadata: ProviderMetadata;
    runsOn?: Paradigm;
    status?: S;
    initialize?(context?: EvaluationContext): Promise<void>;
    onClose?(): Promise<void>;
    track?(trackingEventName: string, context: EvaluationContext, trackingEventDetails: TrackingEventDetails): void;
}

Type Parameters

Properties

events?: ProviderEventEmitter<AnyProviderEvent, Record<string, unknown>>

An event emitter for ProviderEvents.

ProviderEvents

runsOn?: Paradigm

Represents where the provider is intended to be run. If defined, the SDK will enforce that the defined paradigm at runtime.

status?: S

the SDK now maintains the provider's state; there's no need for providers to implement this field. Returns a representation of the current readiness of the provider.

Providers which do not implement this method are assumed to be ready immediately.

Methods

  • A function used to setup the provider. Called by the SDK after the provider is set if the provider's status is NOT_READY. When the returned promise resolves, the SDK fires the ProviderEvents.Ready event. If the returned promise rejects, the SDK fires the ProviderEvents.Error event. Use this function to perform any context-dependent setup within the provider.

    Parameters

    Returns Promise<void>

  • A function used to shut down the provider. Called when this provider is replaced with a new one, or when the OpenFeature is shut down.

    Returns Promise<void>