API-REFERENCES
sd-agent.js

API Reference: sd-agent

The sd-agent exposes a lightweight, non-blocking API designed primarily for pushing custom telemetry and business events (like conversions) into your 24-hour hardware audit.

To ensure safety and prevent race conditions if your application code executes before the agent script fully loads, all commands are queued asynchronously via the window.sdAgent object (see installation docs).

Sending Events

sdAgent.send(eventName)

Pushes a custom event to the ScaleDynamics endpoint. This is primarily used to correlate specific business outcomes (like successful checkouts or sign-ups) with the user's underlying hardware profile.

  • Arguments:
  • eventName (String): The name of the event. To utilize the built-in conversion tracking for your audit, use the reserved string 'conversion_done'.

Example: Tracking a React Checkout

function handleCheckoutSuccess() {
  // Execute your standard checkout logic
  ...
 
  // Safely trigger the ScaleDynamics conversion event
  if (window.sdAgent) {
    window.sdAgent.send('conversion_done');
  }
}