Skip to main content
@ai-billing/lago
@ai-billing/lago / createLagoDestination

Function: createLagoDestination()

createLagoDestination<TTags>(options): Destination<TTags>
Defined in: lago-destination.ts:73 Creates a Destination that ingests billing events into Lago. Identity is extracted from tags (Lago external_customer_id). If no identity is present, the event is skipped to avoid ingesting anonymous data. Cost: Each event must include BillingEvent.cost. The payload always includes cost_nanos and currency derived from event.cost using non-null assertion; omitting cost causes undefined runtime behavior (typically a throw in costToNumber or when reading currency).

Type Parameters

TTags

TTags extends JSONObject = JSONObject The shape of the tags object, extending DefaultTags.

Parameters

options

LagoDestinationOptions<TTags> Destination configuration; see LagoDestinationOptions.

Returns

Destination<TTags> A destination function that sends events to Lago.