SDK
Install and use the published Doclight JavaScript SDKs (npm 0.1.0) to send application telemetry from your Express site, Node.js code or your own MCP server.
Doclight SDKs send application telemetry from your servers to a compatible Doclight ingestion service. Use the Express integration to observe requests that reach your website, the Node client for explicit events, and the MCP integration to record tool execution inside an MCP server you run.
Version covered: npm 0.1.0 for all four packages (latest at the time of writing). Source:
github.com/doclight-lab.
Repository main is ahead of npm 0.1.0
These pages describe only what the published 0.1.0 packages contain. The public repositories contain newer code (for
example Express collect, trackWebsiteRequest, getDoclightMcp) that is not in 0.1.0. A README on GitHub is not
release evidence: check the installed version before copying an option.
Choose your integration
| Integration | Install | Use it for | Guide |
|---|---|---|---|
| Express | pnpm add @doclight/[email protected] | Incoming HTTP requests, routes, response status and timing | Express |
| Node.js | pnpm add @doclight/[email protected] | Explicit session, tool and HTTP events in server-side JavaScript | Node.js |
| MCP instrumentation | pnpm add @doclight/[email protected] | Tool execution inside your own MCP server | MCP instrumentation |
| Core | pnpm add @doclight/[email protected] | Building an adapter or custom transport | Core reference |
Package pages on npm: @doclight/express, @doclight/node, @doclight/mcp, @doclight/core. Repositories: sdk-express, sdk-node, sdk-mcp, sdk-core.
npm and yarn work too; the examples use pnpm.
Prerequisites
- Node.js
>=18(all four packages declare it). Use a currently supported Node release in production. - Express 4 or 5 for
@doclight/express(peer dependency^4.0.0 || ^5.0.0). @modelcontextprotocol/sdkfor@doclight/mcp(peer dependency>=1.0.0; the examples were written against1.29.0).- Packages ship ESM, CommonJS and TypeScript declarations. The JavaScript examples use ESM (
.mjsor"type": "module"). - An ingestion credential and project ID accepted by the ingestion service you send to. See below.
Credentials are not interchangeable
SDK ingestion credentials and project IDs are separate from your Doclight API credential
(aeok_...) and from a brand's numeric ID. Do not reuse one for the other. Keep SDK keys on the server only.
Not the analytics MCP server
@doclight/mcp instruments an MCP server you build, so you can see how agents use your tools. It is not the
Doclight MCP server, which exposes your visibility data to AI clients such as Claude Code. Installing one
does not install the other.
Not supported today
- There is no published Python SDK, so there is no Python package to install for Doclight until a distribution is released.
- Frameworks other than Express have no dedicated adapter. Use the Node client or core.
- doclight-example-mcp is an example application, not an SDK. Its
package configuration still uses local
file:.yalc/...links, so a fresh clone is not a registry-package quickstart.
Delivery status
The SDK posts batches to POST {endpoint}/v1/events/batch (default endpoint https://ingest.doclight.app). Whether your
events then appear in the Doclight dashboard depends on the ingestion service accepting that contract. End-to-end
dashboard delivery has not been verified for this release, so these docs make no promise about it. Confirm receipt on
your own receiver first.
Next steps
- Express: instrument incoming website requests.
- Node.js: send explicit events and understand delivery limits.
- MCP instrumentation: measure tool execution in your own server.
- Core reference: event schema, configuration and transport interface.
- Privacy and troubleshooting: what is collected, what the data cannot prove, and diagnostics.