Skip to main content
Send multiple signals to different entities in a single batch operation for improved performance.

Signature

async function sendBulkSignals(
  signals: SignalCreate[]
): Promise<void>

Parameters

signals
SignalCreate[]
required
Array of signal objects to send. Each signal must include:
  • entity_type: Type of entity (‘session’ | ‘trace’ | ‘span’ | ‘completion’)
  • entity_id: UUID of the entity
  • name: Name of the signal
  • value: Signal value (string, boolean, or number)
  • signal_type: Optional signal type (‘boolean’ | ‘numerical’)

Returns

A Promise<void> that resolves when all signals have been sent.

Examples

Send multiple signals to different entities

import { sendBulkSignals } from 'zeroeval';

await sendBulkSignals([
  {
    entity_type: 'trace',
    entity_id: traceId,
    name: 'api_calls_count',
    value: 5,
    signal_type: 'numerical'
  },
  {
    entity_type: 'session',
    entity_id: sessionId,
    name: 'is_authenticated',
    value: true,
    signal_type: 'boolean'
  }
]);

Send signals with auto-detected types

import { sendBulkSignals } from 'zeroeval';

await sendBulkSignals([
  {
    entity_type: 'trace',
    entity_id: traceId,
    name: 'execution_time',
    value: 1234
  },
  {
    entity_type: 'span',
    entity_id: spanId,
    name: 'success',
    value: true
  },
  {
    entity_type: 'session',
    entity_id: sessionId,
    name: 'user_type',
    value: 'premium'
  }
]);

Type Definitions

interface SignalCreate {
  entity_type: 'session' | 'trace' | 'span' | 'completion';
  entity_id: string;
  name: string;
  value: string | boolean | number;
  signal_type?: 'boolean' | 'numerical';
}

Build docs developers (and LLMs) love