LoopLoop

Signals

Ingest external data into the Loop feedback pipeline using the TypeScript SDK.

Signals

The loop.signals resource ingests external events (errors, metrics, user feedback) into the Loop pipeline. Each ingested signal automatically creates a linked triage issue.

Ingest a signal

const result = await loop.signals.ingest({
  source: 'monitoring',
  type: 'metric-alert',
  severity: 'high',
  payload: {
    metric: 'error_rate',
    value: 12.1,
    threshold: 5.0,
    message: 'Error rate spike on checkout endpoint',
  },
});

console.log(result.signal.id); // Signal record ID
console.log(result.issue.id); // Linked triage issue ID
console.log(result.issue.number); // Issue number (e.g. 46)

Parameters

IngestSignalParams

FieldTypeRequiredDescription
sourcestringYesOrigin identifier (e.g. "posthog", "sentry")
sourceIdstringNoExternal ID for deduplication
typestringYesSignal category (e.g. "metric-alert", "error")
severitySignalSeverityYes"low", "medium", "high", or "critical"
payloadSignalPayloadYesArbitrary JSON data for the signal
projectIdstringNoAssociate with a specific project

Response

The ingest method returns a SignalIngestResponse containing both the created signal and the linked issue:

interface SignalIngestResponse {
  signal: Signal;
  issue: Issue;
}

The created issue has type: "signal" and status: "triage", placing it in the triage queue for agent processing.

Examples

CI pipeline failure

await loop.signals.ingest({
  source: 'ci',
  sourceId: `run-${runId}`,
  type: 'build-failure',
  severity: 'high',
  payload: {
    pipeline: 'main',
    exitCode: 1,
    failedStep: 'test',
    commitSha: 'abc123',
  },
});

User feedback

await loop.signals.ingest({
  source: 'feedback-form',
  type: 'user-feedback',
  severity: 'medium',
  payload: {
    userId: 'usr_123',
    message: 'Checkout page loads slowly after recent update',
    page: '/checkout',
  },
  projectId: 'clx1abc2def3ghi4jkl5mnop',
});

With request options

await loop.signals.ingest(
  {
    source: 'sentry',
    type: 'error',
    severity: 'critical',
    payload: { errorId: 'evt_456', message: 'Unhandled exception' },
  },
  { timeout: 10_000 }
);