RUM JavaScript API - 1.345.1
    Preparing search index...

    Function subscribe

    • Safe wrapper for dynatrace.userActions.subscribe which reverts to a noop if RUM JavaScript or the user actions module is not available.

      Parameters

      • subscriber: (userAction: UserActionTracker) => void

        A callback function that is called whenever Dynatrace creates a new user action.

      Returns () => void

      An unsubscriber function to remove the subscription, or undefined if the user actions module is not enabled.

      import * as userActions from "@dynatrace/rum-javascript-sdk/api/user-actions";
      const unsubscribe = userActions.subscribe((userAction) => {
      console.log('New user action created');
      userAction.completeAutomatically = false;
      });
      // later
      unsubscribe?.();