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

# TypeScript SDK

> Browser and Node.js client for the Alterscope API. Beta.

<Note>
  The TypeScript SDK (`@alterscope/sdk`) is in beta; GA is targeted for late Q2 2026. The package name and import surface on this page are stable and will not change at GA.
</Note>

## Install

```bash theme={null}
npm install @alterscope/sdk
# or
yarn add @alterscope/sdk
```

Node 20+ and modern browsers are supported. The SDK ships ESM and CJS bundles.

## Quick start

```typescript theme={null}
import { AlterscopeClient, freshnessStatusOf } from "@alterscope/sdk";

const client = new AlterscopeClient({ apiKey: process.env.ALTERSCOPE_API_KEY! });

const oracle = await client.oracles.classify({ marketId: "morpho-usdc-lending" });
console.log("freshness", freshnessStatusOf(oracle));
```

Resources mirror the API surface (e.g. `client.oracles`, `client.yieldOpportunities`); `freshnessStatusOf` reads the [agentic envelope](/develop/concepts/agentic-envelope) freshness status off any response.

## Browser usage

Never embed an `sk_live_` key in browser code. Mint a short-lived session token from your backend and pass it to the SDK as `apiKey`. The SDK does not send credentials over insecure transports.

## Real-time and webhooks

For WebSocket subscriptions and signed-webhook verification, see [Realtime → WebSockets](/develop/realtime/websockets) and [Webhooks](/develop/realtime/webhooks).
