open-index/open-npm huggingface dataset:
npm package: @omni-datastream/sdk-js
Description: TypeScript and JavaScript SDK for Omni Datastream
Latest version: 0.1.0

# @omni-datastream/sdk-js

TypeScript and JavaScript SDK for Omni Datastream.

## Install

```bash
npm install @omni-datastream/sdk-js
```

## Quickstart

```ts
import { OmniDatastreamClient } from "@omni-datastream/sdk-js"

const client = new OmniDatastreamClient({
  apiKey: process.env.OMNI_DATASTREAM_API_KEY,
})

const entity = await client.resolveEntity({ ticker: "AAPL" })
const filing = await client.latestFiling({ ticker: "AAPL", form: "10-K" })
const section = await client.latestSection({
  ticker: "AAPL",
  form: "10-K",
  sectionKey: "item_1a",
  mode: "compact",
})

console.log(entity, filing, section)
```

## Error handling

```ts
import { OmniDatastreamClient, OmniDatastreamError } from "@omni-datastream/sdk-js"

const client = new OmniDatastreamClient({
  apiKey: process.env.OMNI_DATASTREAM_API_KEY,
})

try {
  await client.requestDiagnostics("missing-request-id")
} catch (error) {
  if (error instanceof OmniDatastreamError) {
    console.error(error.status, error.requestId, error.body)
  }
}
```

## MCP-adjacent usage

```ts
const mcpInfo = await client.mcpInfo()
console.log(mcpInfo)

const toolResult = await client.mcp({
  jsonrpc: "2.0",
  id: "1",
  method: "tools/call",
  params: {
    name: "entities.resolve",
    arguments: { ticker: "AAPL" },
  },
})
```