Skip to content

The engagement resource lets you force a fresh pull of likes, comments, shares, and impressions from every platform.

Engagement syncs automatically every 6 hours via a cron (covering the last 7 days of posts), so you usually don't need to call this manually.

When to use it ​

  • After importing posts from another scheduler — pull the current metrics
  • For real-time dashboards — trigger an immediate sync before reading
  • Recovering from platform API outages — re-fetch what was missed

Trigger a sync ​

typescript
const { enqueued } = await socifyr.engagement.backfill()
console.log(`Queued ${enqueued} posts for engagement sync`)

backfill() walks up to 200 of the workspace's completed / partial_failure posts (no date limit) and enqueues a fetch job for each channel that:

  • published successfully and has a platform post ID
  • hasn't been deleted on-platform, marked draft, or flagged insights-unavailable
  • has had metrics pulled fewer than 4 times — so re-running it once doesn't re-fetch everything

It returns immediately with the count of jobs queued — actual sync time depends on the number of posts and per-platform rate limits.

Reading the synced metrics ​

After the job completes, the new values are visible via analytics.get() and analytics.getPost().