@getclarify/nodejs-sdk
JavaScript/TypeScript SDK for the Clarify platform.
Prerequisites
- Node.js >= 18.0.0
- pnpm
Development
Install dependencies
pnpm install
Build
Build ESM, CJS, and type definitions:
pnpm run build
Individual build targets:
pnpm run build:esm # ES modules
pnpm run build:cjs # CommonJS
pnpm run build:types # TypeScript declarations
Clean build artifacts:
pnpm run clean
Lint
pnpm run lint # Check for issues
pnpm run lint:fix # Auto-fix issues
Test
pnpm run test # Run tests once
pnpm run test:watch # Watch mode
pnpm run test:cov # With coverage
Type check
pnpm run tsc # One-time check
pnpm run tsc:watch # Watch mode
Publishing
1. Ensure tests pass and code is clean
pnpm run lint
pnpm run test
pnpm run build
2. Update version
pnpm version patch # 0.0.1 -> 0.0.2
pnpm version minor # 0.0.1 -> 0.1.0
pnpm version major # 0.0.1 -> 1.0.0
3. Verify package contents
pnpm publish --dry-run
4. Publish
pnpm publish
Authentication
If not logged in:
pnpm login
Or set a token for CI:
pnpm config set //registry.npmjs.org/:_authToken=YOUR_NPM_TOKEN