Getting Started
Runtime Requirements
- Node.js
>=20 - a CSFloat API key for authenticated account routes
- TypeScript is optional, but the package is designed to be TypeScript-first
Install
npm install csfloat-node-sdkThe package page is:
Configure
Create .env from .env.example:
CSFLOAT_API_KEY=your_api_key_hereMost public read routes still expect you to initialize the SDK with an API key, so treat the key as the normal entrypoint even if your first calls are public listings or schema reads.
Create Your First Client
import { CsfloatSdk } from "csfloat-node-sdk";
const sdk = new CsfloatSdk({
apiKey: process.env.CSFLOAT_API_KEY!,
minRequestDelayMs: 1250,
maxRetries: 2,
retryDelayMs: 250,
});Key CsfloatClientOptions you will care about first:
apiKeyRequired for the normal SDK flow.minRequestDelayMsOpt-in client-side pacing for scanners, bots, or operators.maxRetries,retryDelayMs,maxRetryDelayMsRetry policy for retryable failures.timeoutMsPer-request timeout.fetch,dispatcherAdvanced transport customization.
See Transport, Errors, And Metadata for the full option set.
First Useful Calls
import {
CsfloatSdk,
getPublicMarketPageParams,
} from "csfloat-node-sdk";
const sdk = new CsfloatSdk({
apiKey: process.env.CSFLOAT_API_KEY!,
});
const rates = await sdk.meta.getExchangeRates();
const listings = await sdk.listings.getListings(getPublicMarketPageParams());
const me = await sdk.account.getMe();
const inventory = await sdk.inventory.getInventory();First Useful Advanced Calls
If you want a quicker win than wiring multiple calls by hand:
const feeds = await sdk.workflows.getPublicMarketFeeds({
feed_limit: 3,
public_page_limit: 10,
});
const workspace = await sdk.workflows.getAccountWorkspace({
watchlist_limit: 3,
stall_limit: 3,
});If you need low-level response headers and rate-limit context:
const meWithMetadata = await sdk.client.getWithMetadata("me");
console.log(meWithMetadata.meta.status);
console.log(meWithMetadata.meta.rateLimit?.remaining);What The Package Gives You
The package root exports four major layers:
CsfloatSdkThe normal entrypoint for application code.- resource helpers on
sdk.*account,listings,meta,loadout,history,users,inventory,stall,workflows. - helper modules and constants buy-order builders, market presets, loadout helpers, schema helpers, wear helpers, pagination utilities.
- low-level classes and errors
CsfloatHttpClient,CsfloatSdkError,isCsfloatSdkError.
Recommended First Paths
- Public market scan:
sdk.listings.getListings()orsdk.workflows.getPublicMarketFeeds() - Account dashboard snapshot:
sdk.workflows.getAccountWorkspace() - Buy-order insight lookup:
sdk.workflows.getSingleSkinBuyOrderInsights() - Public loadout discovery:
sdk.loadout.getDiscoverLoadouts() - Exact method-level reference: Resource Reference
- Helper/preset reference: Helpers, Builders, And Constants
- Write payload reference: Write Flows And Payloads
Local Verification
npm test
npm run check
npm run buildFor a publish-ready gate:
npm run release:checkIf you want to exercise the published CLI after a build or from an installed package:
npx csfloat-node-sdk helpWhat To Read Next
- which resource or workflow to use: Resources, Workflows, And Surface Map
- exact public methods: Resource Reference
- helper/builders/constants: Helpers, Builders, And Constants
- write-heavy request payloads and caveats: Write Flows And Payloads
- transport or error behavior: Transport, Errors, And Metadata
- runnable snippets and examples: Examples And Recipes
Last updated on