> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reconifyhq.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Reconify's API reference is read-only for customer data. Do not invent endpoints or authentication behavior beyond the OpenAPI contract.
> The public OpenAPI document contains only the documented external /v2 contract.

# TypeScript quickstart

> Install the TypeScript SDK and send your first monitoring event.

`@reconifyhq/sdk` is a server-side client for Node.js 18 or newer, or any runtime with a
standard `fetch`. It needs a `write` or `admin` key, which
[Authentication](/reference/api/authentication) covers.

<Warning>
  Reconify has no sandbox or test mode. The event you send below becomes immutable evidence
  in your real organization, and the public API deletes nothing.
</Warning>

## Install

The package installs from npm:

```bash npm theme={"theme":{"light":"github-light","dark":"github-dark"}}
npm install @reconifyhq/sdk
```

## Configure a client

A client holds the key and the base URL:

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { ReconifyClient } from "@reconifyhq/sdk";

const client = new ReconifyClient({
  apiKey: process.env.RECONIFY_API_KEY,
});
```

The client reads `RECONIFY_API_KEY` and `RECONIFY_API_URL` when you omit
`apiKey` and `baseUrl`. The default base URL is `https://api.reconifyhq.com`, and
the client appends `/v2` for you. A base URL that already ends in `/v2` works too.

<Warning>
  The constructor throws a `TypeError` when the key is missing or does not start
  with `rk_`. This happens before any network call, so a misconfigured deployment
  fails at startup rather than at the first event.
</Warning>

<Info>
  Store the key in a secret manager. Never commit it, log it, or send it to a
  browser. The SDK is a server-side client.
</Info>

## Send one event

Request fields use the wire format rather than camelCase, so an event carries
`occurred_at`, `entity_id`, and `type`. `amount` is a decimal string such as `"150.00"`,
and a number fails type checking before it reaches the API.

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
const result = await client.ingestion.ingestMonitoringEvents({
  body: {
    events: [
      {
        id: "evt_01J3Y0M8VJQ5W1R3E4J4K7N8P9",
        flow: "payment_to_wallet",
        type: "payment.succeeded",
        occurred_at: "2026-01-01T12:00:00Z",
        amount: "150.00",
        currency: "USD",
        reference: "order-123",
        entity_id: "wallet_123",
      },
    ],
  },
});

for (const item of result.results) {
  console.log(item.index, item.status, item.event_id ?? item.code);
}
```

<Check>
  Each result is `accepted`, `duplicate`, or `rejected`, and its `index` matches the
  position of the event you sent. `accepted` means Reconify stored the event, not that the
  monitored operation is complete.
</Check>

## Read the event back

One field name changes direction: you send `type`, and an event read returns `event_type`.

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
const event = await client.events.getEvent({
  path: { event_id: "evt_01J3Y0M8VJQ5W1R3E4J4K7N8P9" },
});

console.log(event.event_type, event.status);
```

## Next

Build batches, handle every item result, and retry safely in
[Send events with TypeScript](/sdks/typescript/send-events).
