본문으로 건너뛰기

TypeScript SDK

Isomorphic client — same package runs in Node, the browser, and Edge runtimes (Cloudflare Workers, Vercel Edge, Deno).

▸ Package: @bisonai/datamaxi

A dedicated ts.datamaxiplus.com reference site does not exist yet — this is a known gap. Until it lands, the npm README and the type definitions shipped with the package are the source of truth.

Install

npm install @bisonai/datamaxi
# or
pnpm add @bisonai/datamaxi
# or
yarn add @bisonai/datamaxi

Auth

The client reads DTMX_API_KEY from process.env in Node, or accepts an explicit apiKey option in any runtime.

export DTMX_API_KEY="your_api_key_here"

First call

import { Datamaxi } from "@bisonai/datamaxi";

const maxi = new Datamaxi({ apiKey: process.env.DTMX_API_KEY });

const { data, next } = await maxi.cex.candle({
exchange: "binance",
symbol: "BTC-USDT",
interval: "1h",
});

console.log(data.slice(0, 3));

Exact named export (Datamaxi vs Client) and the call-style (object-arg vs positional) may differ in the published package. Check the package's index.d.ts after npm install for the verified shape. Endpoint coverage and symbol format (BASE-QUOTE) are stable across SDKs.

Browser vs Node

Node / Edge — safe

Run the client wherever you can hold an API key as a secret: a backend service, a serverless function, an Edge worker. This is the recommended pattern.

Browser — avoid for production keys

The SDK works in the browser (it ships ESM and uses fetch), but shipping an API key to a browser bundle exposes it to anyone who opens dev tools. CORS will let the call go through; that is not the same as it being safe.

Patterns to use instead:

Proxy through your own backend. Browser hits your server; your server holds the key and forwards to DataMaxi+.

Short-lived scoped keys. Mint a key per session on your backend, hand it to the browser, rotate aggressively.

Server components / RSC. If you're on Next.js or similar, do the data fetch on the server and stream HTML to the client.

Next steps