Skip to content

Commit a417070

Browse files
committed
docs: overhaul docs for 0.9.2
1 parent 66cce8f commit a417070

14 files changed

Lines changed: 1400 additions & 152 deletions

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on Keep a Changelog.
66

77
## [Unreleased]
88

9+
## [0.9.2] - 2026-03-10
10+
11+
### Changed
12+
13+
1. expanded `docs/` from a light task-oriented hub into a fuller package-level documentation set, covering the complete runtime surface across resources, workflows, helper exports, CLI usage, transport behavior, and stability guidance
14+
915
## [0.9.1.5] - 2026-03-10
1016

1117
### Added

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,26 @@ The project is intentionally conservative about claims. Anything called `impleme
1919

2020
> The goal is simple: be the SDK you reach for first if you want serious CSFloat automation instead of a thin wrapper.
2121
>
22-
> Install from npm: [`csfloat-node-sdk@0.9.1.5`](https://www.npmjs.com/package/csfloat-node-sdk)
22+
> Install from npm: [`csfloat-node-sdk@0.9.2`](https://www.npmjs.com/package/csfloat-node-sdk)
2323
2424
## Documentation
2525

26+
The docs set now aims to cover the full public runtime surface of the package, not just the quick-start path.
27+
2628
If you want the fastest path through the SDK, start here:
2729

2830
1. [Documentation Hub](https://github.com/Krablante/csfloat-node-sdk/blob/main/docs/README.md)
2931
2. [Getting Started](https://github.com/Krablante/csfloat-node-sdk/blob/main/docs/getting-started.md)
30-
3. [Resources And Workflows](https://github.com/Krablante/csfloat-node-sdk/blob/main/docs/resources-and-workflows.md)
31-
4. [Transport, Errors, And Metadata](https://github.com/Krablante/csfloat-node-sdk/blob/main/docs/transport-and-errors.md)
32-
5. [Examples And Recipes](https://github.com/Krablante/csfloat-node-sdk/blob/main/docs/examples-and-recipes.md)
33-
6. [API Coverage Matrix](https://github.com/Krablante/csfloat-node-sdk/blob/main/API_COVERAGE.md)
34-
35-
Current recommendation:
36-
37-
1. keep documentation GitHub/npm-first while the information architecture is still evolving
38-
2. only add a separate docs site later, using this same Markdown content as the source of truth
32+
3. [Resources, Workflows, And Surface Map](https://github.com/Krablante/csfloat-node-sdk/blob/main/docs/resources-and-workflows.md)
33+
4. [Resource Reference](https://github.com/Krablante/csfloat-node-sdk/blob/main/docs/resource-reference.md)
34+
5. [Helpers, Builders, And Constants](https://github.com/Krablante/csfloat-node-sdk/blob/main/docs/helpers-and-builders.md)
35+
6. [Workflows And CLI](https://github.com/Krablante/csfloat-node-sdk/blob/main/docs/workflows-and-cli.md)
36+
7. [Transport, Errors, And Metadata](https://github.com/Krablante/csfloat-node-sdk/blob/main/docs/transport-and-errors.md)
37+
8. [Examples And Recipes](https://github.com/Krablante/csfloat-node-sdk/blob/main/docs/examples-and-recipes.md)
38+
9. [Stability And Coverage](https://github.com/Krablante/csfloat-node-sdk/blob/main/docs/stability-and-coverage.md)
39+
10. [API Coverage Matrix](https://github.com/Krablante/csfloat-node-sdk/blob/main/API_COVERAGE.md)
40+
41+
These Markdown docs ship in the npm tarball as well, so npm users are not forced onto a separate site just to understand the SDK.
3942

4043
## Why Choose This SDK
4144

docs/README.md

Lines changed: 64 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,77 @@
11
# Documentation Hub
22

3-
This SDK already ships a broad surface. The fastest way to make it usable is not
4-
to make the main README even longer, but to give users a clear map.
3+
This docs set is meant to cover the full public runtime surface of `csfloat-node-sdk`:
54

6-
If you are reading this on npm:
5+
- `CsfloatSdk` resources
6+
- `sdk.client` and `CsfloatHttpClient`
7+
- workflow helpers
8+
- builder/helper/constant exports from the package root
9+
- CLI commands
10+
- the stability and coverage notes needed to use the SDK responsibly
711

8-
1. start with the repository README for the high-level pitch and install snippet
9-
2. use this `docs/` directory for task-oriented guidance
10-
3. use `API_COVERAGE.md` when you need endpoint-level truth
12+
If you are reading this from the published npm package, these files ship in the tarball.
1113

12-
## Start Here
14+
## Recommended Reading Order
1315

14-
- [Getting Started](./getting-started.md)
15-
First install, API key setup, first requests, local verification.
16-
- [Resources And Workflows](./resources-and-workflows.md)
17-
Which SDK surface to use for market reads, account automation, loadouts, and higher-level helpers.
18-
- [Transport, Errors, And Metadata](./transport-and-errors.md)
19-
Retries, pacing, typed errors, and the new opt-in response metadata surface.
20-
- [Examples And Recipes](./examples-and-recipes.md)
21-
Examples, CLI commands, and which script to run for common tasks.
16+
1. [Getting Started](./getting-started.md)
17+
Install, first client, first requests, and where to go next.
18+
2. [Resources, Workflows, And Surface Map](./resources-and-workflows.md)
19+
Which surface to use for each kind of task.
20+
3. [Resource Reference](./resource-reference.md)
21+
The method-level reference for `sdk.meta`, `sdk.account`, `sdk.listings`, and the rest.
22+
4. [Helpers, Builders, And Constants](./helpers-and-builders.md)
23+
Every exported helper module and the constants that shape queries or requests.
24+
5. [Workflows And CLI](./workflows-and-cli.md)
25+
The higher-level orchestration layer plus the published CLI commands.
26+
6. [Transport, Errors, And Metadata](./transport-and-errors.md)
27+
`CsfloatHttpClient`, retries, pacing, metadata responses, and error handling.
28+
7. [Examples And Recipes](./examples-and-recipes.md)
29+
Runnable examples plus copyable snippets for common flows.
30+
8. [Stability And Coverage](./stability-and-coverage.md)
31+
How to interpret implemented vs low-level vs account-gated behavior.
32+
9. [`API_COVERAGE.md`](../API_COVERAGE.md)
33+
Endpoint-level truth for validated and discovered routes.
2234

23-
## How To Read This SDK
35+
## Choose By Task
2436

25-
Use the SDK in three layers:
37+
- First request or install help:
38+
[Getting Started](./getting-started.md)
39+
- Which resource or helper to reach for:
40+
[Resources, Workflows, And Surface Map](./resources-and-workflows.md)
41+
- Exact public methods on each resource:
42+
[Resource Reference](./resource-reference.md)
43+
- Exported builders, presets, constants, and pagination helpers:
44+
[Helpers, Builders, And Constants](./helpers-and-builders.md)
45+
- High-level snapshot helpers or CLI usage:
46+
[Workflows And CLI](./workflows-and-cli.md)
47+
- Transport behavior, retries, rate limits, or raw metadata:
48+
[Transport, Errors, And Metadata](./transport-and-errors.md)
49+
- Copyable code for real tasks:
50+
[Examples And Recipes](./examples-and-recipes.md)
51+
- Support confidence, caveats, and route truth:
52+
[Stability And Coverage](./stability-and-coverage.md) and [`API_COVERAGE.md`](../API_COVERAGE.md)
2653

27-
1. `CsfloatSdk` resources for normal application code
28-
2. helpers/builders/workflows when you want less glue code
29-
3. `sdk.client.*WithMetadata()` when you need low-level response visibility
54+
## What This Docs Set Covers
3055

31-
## Where Different Kinds Of Truth Live
32-
33-
- Product overview: `README.md`
34-
- Stable endpoint coverage notes: `API_COVERAGE.md`
35-
- Release history: `CHANGELOG.md`
36-
- Task-oriented usage: `docs/*.md`
37-
- Executable examples: `examples/*.mjs`
38-
39-
## Should You Build A Separate Docs Site?
56+
- every public runtime entrypoint exported from the package root
57+
- every SDK resource and workflow method
58+
- the helper functions and constants that materially affect day-to-day usage
59+
- the published CLI surface
60+
- the transport and error model
4061

41-
Not yet, unless you are ready to keep GitHub, npm, and the site in sync.
62+
The root package also exports a very large TypeScript type surface. These docs call out the important request and response types by area, but the generated `.d.ts` files and your IDE remain the authoritative field-level reference.
4263

43-
The better near-term strategy is:
44-
45-
1. keep GitHub + npm-readable docs as the source of truth
46-
2. keep docs in Markdown inside the package repository
47-
3. only later add a Vercel-hosted site that reuses this same content
64+
## Where Different Kinds Of Truth Live
4865

49-
That way npm users are not forced onto an external site just to understand the
50-
package, and a future docs site becomes a presentation layer, not a second
51-
documentation system.
66+
- Product overview and install snippet:
67+
[`README.md`](../README.md)
68+
- Runtime docs:
69+
`docs/*.md`
70+
- Endpoint-by-endpoint validation and discovery notes:
71+
[`API_COVERAGE.md`](../API_COVERAGE.md)
72+
- Release history:
73+
[`CHANGELOG.md`](../CHANGELOG.md)
74+
- Executable examples:
75+
`examples/*.mjs`
76+
- Tests for supported behavior:
77+
`test/*.test.ts`

docs/examples-and-recipes.md

Lines changed: 148 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
## Shipped Examples
44

5-
These examples are already publishable and included in the npm tarball:
5+
These examples are published with the package and included in the npm tarball:
66

7-
- `examples/basic.mjs`
8-
- `examples/market-public-feeds.mjs`
9-
- `examples/watchlist-stall-iteration.mjs`
10-
- `examples/loadout-companion.mjs`
11-
- `examples/buy-order-expression.mjs`
12-
- `examples/workflows.mjs`
7+
| File | Shows |
8+
|---|---|
9+
| `examples/basic.mjs` | authenticated `me` + inventory + public stall bootstrap |
10+
| `examples/market-public-feeds.mjs` | public listings with homepage/public-page presets |
11+
| `examples/watchlist-stall-iteration.mjs` | authenticated watchlist iteration plus public stall iteration |
12+
| `examples/loadout-companion.mjs` | recommender token flow plus loadout discover/recommend helpers |
13+
| `examples/buy-order-expression.mjs` | single-skin expression preview plus similar buy-order lookup |
14+
| `examples/workflows.mjs` | the higher-level `sdk.workflows` layer end to end |
1315

1416
## Example Commands
1517

@@ -24,13 +26,22 @@ npm run example:workflows
2426

2527
## CLI Commands
2628

29+
If you are working from source after `npm run build`:
30+
2731
```bash
2832
node dist/cli.js help
2933
node --env-file=.env dist/cli.js feeds
3034
node --env-file=.env dist/cli.js workspace
3135
node --env-file=.env dist/cli.js buy-order-similar --def-index 7 --paint-index 72 --stattrak false --souvenir false
3236
```
3337

38+
If you are using the published package:
39+
40+
```bash
41+
npx csfloat-node-sdk help
42+
npx csfloat-node-sdk feeds --api-key "$CSFLOAT_API_KEY"
43+
```
44+
3445
## Recommended Recipe Paths
3546

3647
- Public feed snapshot:
@@ -44,6 +55,136 @@ node --env-file=.env dist/cli.js buy-order-similar --def-index 7 --paint-index 7
4455
- Higher-level multi-call orchestration:
4556
`examples/workflows.mjs`
4657

58+
## Common Recipes
59+
60+
Assume `const sdk = new CsfloatSdk({ apiKey: process.env.CSFLOAT_API_KEY! });` unless the snippet shows otherwise.
61+
62+
### Public Market Snapshot
63+
64+
```ts
65+
import {
66+
CsfloatSdk,
67+
getHomepageFeedParams,
68+
getPublicMarketPageParams,
69+
} from "csfloat-node-sdk";
70+
71+
const sdk = new CsfloatSdk({ apiKey: process.env.CSFLOAT_API_KEY! });
72+
73+
const [publicPage, topDeals] = await Promise.all([
74+
sdk.listings.getListings(getPublicMarketPageParams()),
75+
sdk.listings.getListings(getHomepageFeedParams("top_deals")),
76+
]);
77+
```
78+
79+
### Watchlist Or Stall Iteration
80+
81+
```ts
82+
for await (const listing of sdk.account.iterateWatchlist({
83+
limit: 20,
84+
state: "listed",
85+
sort_by: "most_recent",
86+
})) {
87+
console.log(listing.id);
88+
}
89+
90+
for await (const listing of sdk.stall.iterateStall("76561198000000000", {
91+
limit: 20,
92+
type: "buy_now",
93+
})) {
94+
console.log(listing.id);
95+
}
96+
```
97+
98+
### Compose Search Filters With Helpers
99+
100+
```ts
101+
import {
102+
buildPriceRange,
103+
buildStickerFilters,
104+
withWearPreset,
105+
} from "csfloat-node-sdk";
106+
107+
const listings = await sdk.listings.getListings({
108+
...withWearPreset({ type: "buy_now" }, "MW"),
109+
...buildPriceRange({ min_price: 500, max_price: 5_000 }),
110+
...buildStickerFilters([{ sticker_id: 85, slot: 1 }]),
111+
});
112+
```
113+
114+
### Preview A Buy-Order Request Before Creating It
115+
116+
```ts
117+
import {
118+
buildSingleSkinBuyOrderExpression,
119+
buildSingleSkinBuyOrderRequest,
120+
} from "csfloat-node-sdk";
121+
122+
const expression = buildSingleSkinBuyOrderExpression(7, 72, {
123+
stattrak: false,
124+
souvenir: false,
125+
});
126+
127+
const request = buildSingleSkinBuyOrderRequest(7, 72, {
128+
max_price: 3,
129+
quantity: 1,
130+
stattrak: false,
131+
souvenir: false,
132+
});
133+
134+
const similar = await sdk.account.getSimilarBuyOrders({ expression }, 5);
135+
```
136+
137+
### Recommender Token Loadout Flow
138+
139+
```ts
140+
const recommender = await sdk.account.createRecommenderToken();
141+
142+
const discover = await sdk.loadout.getDiscoverLoadouts({
143+
limit: 5,
144+
def_index: 7,
145+
paint_index: 490,
146+
});
147+
148+
const stickerRecommendations = await sdk.loadout.recommendStickersForSkin(
149+
recommender.token,
150+
7,
151+
490,
152+
{ count: 10 },
153+
);
154+
```
155+
156+
### Response Metadata And Rate Limits
157+
158+
```ts
159+
const response = await sdk.client.getWithMetadata("me");
160+
161+
console.log(response.meta.status);
162+
console.log(response.meta.rateLimit?.remaining);
163+
console.log(response.meta.rateLimit?.suggestedWaitMs);
164+
```
165+
166+
### Schema Media Helpers
167+
168+
```ts
169+
import { getCsfloatScreenshotUrls } from "csfloat-node-sdk";
170+
171+
const screenshot = await sdk.meta.getItemExampleScreenshot({
172+
def_index: 7,
173+
paint_index: 490,
174+
});
175+
176+
console.log(getCsfloatScreenshotUrls(screenshot));
177+
```
178+
179+
### Bulk Listing Mutation
180+
181+
```ts
182+
await sdk.listings.updateBulkListings([
183+
{ contract_id: "123", price: 1_500 },
184+
{ contract_id: "456", price: 2_000 },
185+
]);
186+
```
187+
47188
## How To Decide Between Examples And Docs
48189

49190
- Use docs when you want concepts, boundaries, and entrypoint guidance.

0 commit comments

Comments
 (0)