---
title: Publish and verify an event
description: Publish one OrbitRail event and configure the Verify SDK to validate its signed payload.
url: https://pr-2-f831df687d6c.thally.app/quickstart
---

# Publish and verify an event

Publish one OrbitRail event and configure the Verify SDK to validate its signed payload.

Complete one round trip: publish an event through OrbitRail Events, then verify
the signed payload delivered to your application.

## Before you begin

You need an OrbitRail API key and Node.js 18 or newer.

#### Publish an event

    Send the key in the `X-OrbitRail-Key` header:

    ```bash
    curl --request POST \
      --url https://events.orbitrail.example/v1/events \
      --header 'Content-Type: application/json' \
      --header 'X-OrbitRail-Key: YOUR_API_KEY' \
      --data '{"type":"shipment.ready","payload":{"shipmentId":"shp_123"}}'
    ```

    A successful request returns `202 Accepted`.

#### Install OrbitRail Verify

    ```bash
    npm install @orbitrail/verify
    ```

#### Verify the delivery

    ```ts
    import { createVerifyClient } from "@orbitrail/verify";

    const verifier = createVerifyClient({
      apiKey: process.env.ORBITRAIL_API_KEY!,
      batchSize: 50,
    });

    const isValid = await verifier.verify(requestBody);
    ```

#### Handle the result

    `verify()` resolves to `true` for a valid non-empty payload and `false`
    otherwise. Reject the request before processing when it returns `false`.

Failed event deliveries retry automatically for **24 hours**. Accepted payloads
remain available to replay for **7 days**.