@kingstoneapp/cli
v1.0.0
Published
KINGSTONE Partner Integration Test CLI
Maintainers
Readme
@kingstoneapp/cli
Partner Integration Test CLI for the KINGSTONE B2B API. Validates that your KINGSTONE integration is correctly configured and operational.
Installation
npm install -g @kingstoneapp/cliOr run directly with npx:
npx @kingstoneapp/cli check --api-key ks_test_your_key_hereConfiguration
API key and base URL can be set via CLI flags or environment variables. Flags take priority.
| Setting | CLI Flag | Environment Variable | Default |
|----------|----------------|-------------------------|----------------------------------|
| API Key | --api-key | KINGSTONE_API_KEY | (required) |
| Base URL | --base-url | KINGSTONE_BASE_URL | https://api.kingstone.dev/api |
Environment variable example
export KINGSTONE_API_KEY=ks_test_abc123
export KINGSTONE_BASE_URL=http://localhost:3001/api
kingstone checkCommands
kingstone check
Runs all integration checks in sequence and prints a summary.
kingstone check --api-key ks_test_abc123kingstone check health
Verifies the KINGSTONE API is reachable by hitting the public /health endpoint.
kingstone check health --api-key ks_test_abc123kingstone check auth
Validates your API key by calling an authenticated endpoint.
kingstone check auth --api-key ks_test_abc123kingstone check spin
Executes a test spin against your first registered game using the minimum wager. Requires at least one game registered via POST /partner/v1/games.
kingstone check spin --api-key ks_test_abc123kingstone check webhook
Tests webhook registration by creating and immediately deleting a test webhook endpoint.
kingstone check webhook --api-key ks_test_abc123Example Output
KINGSTONE Integration Checks
INFO Target: http://localhost:3001/api
PASS API Health healthy (42ms)
PASS API Key Authentication 200 OK (18ms)
PASS Test Spin spinId=spin-123 combo=7|7|BAR payout=$0.00 (65ms)
PASS Webhook Registration Registered webhook id=1 events=[spin.large_win] (23ms)
INFO Full webhook delivery testing requires a matching spin event. Registration verified.
Results: 4/4 checks passed — ALL PASSED (148ms)Development
# Run tests
npm run test -w @kingstoneapp/cli
# Type check
npm run typecheck -w @kingstoneapp/cli
# Build
npm run build -w @kingstoneapp/cli
# Run locally
node packages/cli/bin/kingstone.js check --api-key ks_test_abc123 --base-url http://localhost:3001/apiLicense
UNLICENSED -- Proprietary to Predigy Inc.
