---
slug: /for-agents/sdk-reference
sidebar_position: 1
title: SDK Reference (machine-readable)
description: Single-file SDK reference, iframe message protocol JSON, and TypeScript .d.ts bundles for AI agents.
keywords: [myop sdk reference, myop message protocol, myop typescript types, llms.txt, agent docs]
---
# SDK Reference (machine-readable)

The HTML pages under `/docs/sdk*` are generated from TypeScript sources by
TypeDoc. They're great for humans, but they spread the type surface across
hundreds of small pages. This page collects the agent-friendly artifacts in
one place.

## Single-file SDK reference

[`/sdk-reference.md`](pathname:///sdk-reference.md) is the entire SDK API
concatenated into one Markdown file (~500 KB). It covers:

- `@myop/sdk` — core (host, iframe, web component, messages, helpers, common)
- `@myop/react`
- `@myop/react-native`
- `@myop/vue`
- `@myop/angular`

Each section starts with a heading containing the canonical URL on
`docs.myop.dev`, so an agent can cite specific symbols precisely.

## Iframe message protocol (JSON)

[`/message-protocol.json`](pathname:///message-protocol.json) is a generated,
agent-readable catalog of the host↔component message protocol used over
`postMessage`. It lists:

- The envelope shape (`myop`, `messageType`, `id`, `direction`, `route`, `content`)
- All `host → component` message keys (e.g. `InitMessage`, `BindClickMessage`)
- All `component → host` message keys (e.g. `ClickReplayMessage`, `EventListenerCallbackMessage`)

The JSON is regenerated on every docs build from
`myop-sdk/src/common/MyopMessages.ts`, so it stays in sync with the SDK.

For the exact payload shapes, read the corresponding class in `@myop/sdk`
(see `@myop/sdk/dist/messages/*.d.ts`).

## TypeScript `.d.ts` bundles

The published npm packages include hand-authored `.d.ts` files an agent can
consult directly:

| Package | Tarball | Type entry |
|---|---|---|
| [`@myop/sdk`](https://www.npmjs.com/package/@myop/sdk) | `npm pack @myop/sdk` | `dist/index.d.ts` |
| [`@myop/react`](https://www.npmjs.com/package/@myop/react) | `npm pack @myop/react` | `dist/index.d.ts` |
| [`@myop/react-native`](https://www.npmjs.com/package/@myop/react-native) | `npm pack @myop/react-native` | `dist/index.d.ts` |
| [`@myop/vue`](https://www.npmjs.com/package/@myop/vue) | `npm pack @myop/vue` | `dist/index.d.ts` |
| [`@myop/angular`](https://www.npmjs.com/package/@myop/angular) | `npm pack @myop/angular` | `dist/index.d.ts` |

CDN access (no install required):

```text
https://unpkg.com/@myop/sdk/dist/index.d.ts
https://unpkg.com/@myop/react/dist/index.d.ts
https://unpkg.com/@myop/react-native/dist/index.d.ts
https://unpkg.com/@myop/vue/dist/index.d.ts
https://unpkg.com/@myop/angular/dist/index.d.ts
```

Append `@<version>` to pin (e.g. `@myop/sdk@latest`).

## Page-level Markdown

Most doc pages on `docs.myop.dev` are available as raw Markdown by appending
`.md` to the URL:

```text
https://docs.myop.dev/docs/intro.md
https://docs.myop.dev/docs/cli/ai-integration.md
https://docs.myop.dev/docs/learnMyop/HTMLComponent.md
```

**Not mirrored individually:** the auto-generated SDK API reference pages
under `/docs/sdk*`. Fetch them in bulk via `/sdk-reference.md` (above).

A JSON index of every page is published at
[`/docs-index.json`](pathname:///docs-index.json). Each entry's `markdown`
field is either the mirror URL or `null` (when no per-page mirror exists).

## Suggested fetch order

If you only need to answer a quick question:

1. Read the relevant page's `.md` (cheap, scoped).

If you're starting a Myop integration from scratch:

1. [`/llms.txt`](pathname:///llms.txt) — pick a starting point.
2. [`get_myop_guide`](/docs/mcp-setup) over MCP — canonical component guide, no auth.
3. [`/sdk-reference.md`](pathname:///sdk-reference.md) — full SDK API, one fetch.
4. [`/message-protocol.json`](pathname:///message-protocol.json) — only if you're working under the SDK (most agents won't need this).
