@rankwrangler/http-client
v0.4.1
Published
Typed tRPC client for RankWrangler
Readme
@rankwrangler/http-client
Typed tRPC client for the RankWrangler public API.
Install
npm install @rankwrangler/http-clientUsage
import { createRankWranglerClient } from '@rankwrangler/http-client';
const client = createRankWranglerClient({
baseUrl: 'https://rankwrangler.merchbase.co',
apiKey: 'rrk_...'
});
const product = await client.getProductInfo.mutate({
marketplaceId: 'ATVPDKIKX0DER',
asin: 'B0DV53VS61'
});The client is scoped to the public surface (api.public.*) so it stays aligned with CLI usage.
Types
import type { PublicRouterInputs, PublicRouterOutputs } from '@rankwrangler/http-client';
type GetProductInput = PublicRouterInputs['getProductInfo'];
type GetProductOutput = PublicRouterOutputs['getProductInfo'];Maintenance
When the public router changes, regenerate the bundled router types:
bun run http-client:typesBuild the package before publishing:
bun run http-client:buildPublish
From packages/http-client:
set -a
source ../../.env
set +a
npm whoami --userconfig ../../.npmrc
npm publish --access public --userconfig ../../.npmrcBefore publishing:
- Run
bun run release:bump <patch|minor|major|X.Y.Z>from repo root. - Run
bun installfrom repo root. - Run
bun run release:collect-changelog-context, then draftCHANGELOG.mdentry. - Run
bun run release:check. - Run
bun run http-client:buildfrom repo root. - Run
npm pack --dry-runfrompackages/http-client.
Versioning
- App releases and npm package versions are synchronized to the same
X.Y.Z. CHANGELOG.mdusesvX.Y.Z; package files useX.Y.Z.- Canonical process lives in
docs/release-runbook.md.
