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

# Plainrouter SDKs

> Choose an official Plainrouter SDK, check runtime requirements, authenticate server-side requests, and verify conversion ingestion and delivery.

Use an official Plainrouter SDK to send consented conversions from your server and inspect their delivery. The SDKs call the Plainrouter Conversion API; they do not call Meta's Graph API directly.

## Choose your language

Each language guide covers installation, authentication, requests, and verification.

<CardGroup cols={2}>
  <Card title="TypeScript" icon="braces" href="/docs/sdk/typescript">
    Typed operations and Zod schemas for server-side Node.js applications.
  </Card>

  <Card title="Python" icon="code" href="/docs/sdk/python">
    Synchronous and asynchronous clients with typed request models.
  </Card>

  <Card title="Ruby" icon="gem" href="/docs/sdk/ruby">
    A client facade for sending events and reading delivery results.
  </Card>

  <Card title="Go" icon="code" href="/docs/sdk/go">
    Typed requests with context-based authentication and error handling.
  </Card>
</CardGroup>

For a terminal workflow, start with the [CLI quickstart](/docs/cli/get-started), then use the [command reference](/docs/cli/command-reference). To connect an AI agent to governed advertising workflows, use [MCP setup](/docs/mcp/setup).

## Before you begin

| Client     | Runtime                    | Published package                                                            |
| ---------- | -------------------------- | ---------------------------------------------------------------------------- |
| TypeScript | Node.js `22.22.2` or newer | [`@plainrouter/sdk` `0.5.1`](https://www.npmjs.com/package/@plainrouter/sdk) |
| Python     | Python 3.11 or newer       | [`plainrouter` `0.5.2`](https://pypi.org/project/plainrouter/)               |
| Ruby       | Ruby 3.2 or newer          | [`plainrouter-sdk` `0.1.1`](https://rubygems.org/gems/plainrouter-sdk)       |
| Go         | Go 1.23 or newer           | [`sdk-go` `v0.5.2`](https://pkg.go.dev/github.com/plainrouter/sdk-go)        |

Production requests require a **Signals workspace secret** stored on your server. Published clients retain names such as `signalTrackerSecret` and "tracker token" for this credential. An MCP workspace execution token is a separate credential and cannot authenticate Conversion API requests. See [Authentication](/docs/api/authentication).

To deliver conversions to Meta, [connect the intended dataset](/docs/signals/connect-meta) and capture the required [event consent](/docs/signals/track-events). Without production setup, you can explore the request contract in the [synthetic API sandbox](/docs/api/sandbox).

## Build your first integration

1. **Install and configure one client.** Follow your language guide above. Pin its package version and keep the Signals secret out of browser bundles.
2. **Check access.** Read recent events using the guide's authenticated client. A successful empty response is valid; it does not prove that browser collection is installed.
3. **Verify ingestion.** Use the SDK's ingestion diagnostic. It records an identity-free verification event; it does not establish real arrival evidence or complete onboarding. See [Verify Signal ingestion](/docs/signals/verify-ingestion).
4. **Send a conversion and inspect delivery.** Follow the [Node.js and TypeScript recipe](/docs/sdk/recipes/meta-conversions), or the purchase example in the [Python](/docs/sdk/python#send-a-meta-conversion), [Ruby](/docs/sdk/ruby#send-a-meta-conversion), or [Go](/docs/sdk/go#send-a-meta-conversion) guide. Preserve the original event ID and payload on retries.

A new event's `202` acknowledgement confirms ingestion. Check the event's delivery trace separately: a delivery with `status: "accepted"` confirms destination acceptance. Acceptance does not establish attribution or improved advertising performance. See [delivery status meanings](/docs/reference/statuses-and-terms#destination-delivery).

## What do the clients cover?

All four SDKs target signed API contract `0.5.0` and cover event creation and retrieval, ingestion verification, destination testing, delivery replay, reports, and user-data deletion. Package versions are independent of the API contract version. Review release notes before upgrading. For compatibility in published `0.5.x` clients, see [Read workspace identifiers](/docs/api/conversions#read-workspace-identifiers).

| Task                                                | Documentation                                                                   |
| --------------------------------------------------- | ------------------------------------------------------------------------------- |
| Send purchases or leads from application code       | Your language guide and the [event consent contract](/docs/signals/track-events).    |
| Inspect events or stored reports in a terminal      | [CLI commands](/docs/cli/command-reference).                                         |
| Review request fields, responses, and API failures  | [API reference](/docs/api/introduction) and [conversion handling](/docs/api/conversions). |
| Install browser measurement                         | [Signals browser snippet](/docs/signals/install-pixel).                              |
| Read account context or propose advertising actions | [MCP introduction](/docs/mcp/overview).                                              |

The CLI exposes nine API commands. It has no ingestion-verification or cursor-based event-listing command; use an SDK or REST for those operations. Install the CLI from [npm](https://www.npmjs.com/package/@plainrouter/cli), [PyPI](https://pypi.org/project/plainrouter/), or the [official Homebrew tap](https://github.com/plainrouter/homebrew-tap). Choose one global installation so your shell runs the intended executable.

## What if the integration does not work?

| Symptom                                     | Check                                                                                                                                                                   |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `401` authentication failure                | Use the Signals secret for the intended workspace. MCP tokens are not API credentials.                                                                                  |
| `422` validation failure                    | Inspect the returned field errors and the [event contract](/docs/api/conversions#handle-errors), including consent fields.                                                   |
| Timeout while sending a purchase            | Retry with its original persisted event ID and payload; do not generate another conversion ID.                                                                          |
| Event accepted but Meta delivery is pending | Read the event trace and check the [connected destination](/docs/signals/connect-meta). Ingestion and delivery are separate results.                                         |
| Empty event list despite visible arrivals   | Arrival totals are aggregate-only and do not appear as conversion events. Use [Signals reporting](/docs/signals/health-and-performance#arrivals-vs-platform-claimed-clicks). |

The language guides describe each client's response and error handling. For terminal-specific failures, see [CLI troubleshooting](/docs/cli/get-started#what-if-the-first-command-fails).
