RUM JavaScript API - 1.345.1
    Preparing search index...

    Function sendEvent

    • Async wrapper for dynatrace.sendEvent.

      Parameters

      • fields: ApiCreatedEventPropertiesEvent

        Must be a valid JSON object and cannot contain functions, undefined, Infinity and NaN as values, otherwise they will be replaced with null. The fields need to be serializable using JSON.stringify. The resulting event will be populated with fields parameter, and modified with additional properties, thus also empty objects are valid. Only properties prefixed with event_properties., the duration property and the start_time property are allowed.

      • OptionaleventContext: unknown

        An optional context that can be used to manipulate the result event within the modification callback.

      • timeout: number = DEFAULT_AGENT_TIMEOUT

        Timeout in milliseconds to wait for the RUM JavaScript to be available (default: 10000)

      Returns Promise<void>

      A DynatraceError if the RUM JavaScript is not available within the timeout, or the namespace is overridden with an incompatible object

      import { sendEvent } from '@dynatrace/rum-javascript-sdk/api/promises';

      await sendEvent({
      'event_properties.conversion': 'purchase',
      'event_properties.value': 149.99
      });