Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.unprice.dev/llms.txt

Use this file to discover all available pages before exploring further.

const { result, error } = await unprice.events.ingestSync({
  idempotencyKey: "idem_123",
  eventSlug: "tokens_used",
  featureSlug: "tokens",
  customerId: "cus_1234567890",
  properties: {
    amount: 1
  }
});

if (error) {
  console.error(error.message);
  return;
}

console.log(result);
{
  "allowed": true,
  "state": "processed"
}

Request

featureSlug
string
required
The feature slug to verify while ingesting.
idempotencyKey
string
required
Logical key used to deduplicate the event.
eventSlug
string
required
The event slug configured in Unprice.
properties
object
required
Event properties used by meters.

Response

Returns whether the event was processed or rejected for the targeted feature.