Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

1.0 KB
Raw Blame
/**
 * @deprecated Use Observability API instead
 * This service is kept for backward compatibility but forwards all calls to the new Observability API
 *
 * Migration:
 * - Replace Analytics.track() with Observability.observeInteraction()
 */

import { Observability } from '@src/shared/observability';
import { isProdEnv } from '@src/shared/utils';

export const Analytics = {
  /**
   * @deprecated Use Observability.observeInteraction() instead
   */
  track: (eventName: string, properties: Record<string, unknown> = {}) => {
    try {
      // Forward to Observability API
      const enhancedProperties = { ...properties };

      // Add isProd if not already present to differentiate between prod and dev events
      if (!('isProd' in enhancedProperties)) {
        enhancedProperties.isProd = isProdEnv();
      }

      // Forward to new Observability API
      Observability.observeInteraction(eventName, enhancedProperties);
    } catch (error) {
      console.info('Error tracking event', error);
    }
  },
};