ReactionSaaS
Documentation

API Reference

ReactionSDK client methods and REST entrypoints for overlay interactions on video. For ReactifySDK (recorded reactions, threads, uploads) and /api/reactify/*, see ReactifySDK API reference.

createOverlay()

ReactionSDK

Creates and attaches an overlay (tap, poll, rating, slider, or CTA) to a video element. The overlay is rendered in the DOM and starts listening for user interactions. Use this when you need to add overlays programmatically instead of via markup.

Parameters

NameTypeRequiredDescription
videoElementHTMLVideoElementYesThe video element to attach the overlay to.
optionsOverlayOptionsYesConfiguration: type ('tap' | 'rating' | 'poll' | 'slider' | 'cta'), position, pollQuestion, ctaText, etc.
campaignIdstringNoOptional campaign ID for analytics attribution.

Example usage

Example
const video = document.querySelector('#my-video');
ReactionSDK.createOverlay(video, {
  type: 'rating',
  position: 'bottom-center',
  ctaText: 'Submit',
});
// Overlay is now visible and tracking interactions.

Response structure

Response
{
  "success": true,
  "overlayId": "ovl_abc123",
  "videoId": "vid_xyz789"
}

trackInteraction()

ReactionSDK

Sends an interaction event to the ReactionSaaS ingest API. Call this when you capture a custom interaction (e.g. from your own UI) or to batch events. For overlay-driven interactions, the SDK calls this automatically.

Parameters

NameTypeRequiredDescription
payloadInteractionPayloadYesEvent payload: eventType, interactionType, value, videoId, sessionId, timestampMs, etc.
options{ dedupeKey?: string }NoOptional deduplication key to avoid double-counting.

Example usage

Example
ReactionSDK.trackInteraction({
  eventType: 'interaction',
  interactionType: 'rating',
  value: 5,
  videoId: 'product-demo-1',
  sessionId: 'sess_xyz',
  timestampMs: Date.now(),
});

Response structure

Response
{
  "ok": true,
  "eventId": "evt_123abc",
  "receivedAt": "2024-01-15T14:32:18.500Z"
}

getAnalytics()

ReactionSDK

Returns analytics for the current account or a given campaign/creative. Use this to fetch impression counts, interaction counts, and engagement metrics client-side (e.g. for in-app dashboards). For full analytics, use the dashboard or REST API.

Parameters

NameTypeRequiredDescription
paramsGetAnalyticsParamsNoOptional: campaignId, creativeId, dateFrom, dateTo. Omit for account-level summary.

Example usage

Example
const analytics = await ReactionSDK.getAnalytics({
  campaignId: 'camp_abc',
  dateFrom: '2024-01-01',
  dateTo: '2024-01-31',
});
console.log(analytics.impressions, analytics.interactions, analytics.engagementRate);

Response structure

Response
{
  "impressions": 125000,
  "interactions": 48200,
  "engagementRate": 0.3856,
  "byType": {
    "tap": 12000,
    "rating": 18000,
    "poll": 10000,
    "slider": 8200
  },
  "period": { "from": "2024-01-01", "to": "2024-01-31" }
}

REST API

For server-side and high-volume use, see the REST API: event ingestion (POST /api/sdk/event), init (POST /api/sdk/init), conversion (POST /api/sdk/conversion), and dashboard analytics endpoints. Authentication uses a Bearer API key.