Upgrade notes
Node.js 22.12+ is required.
Changes
- HTTP error responses throw
ValenAPIError: a non-JSON error page (such as a gateway's HTML 502) keeps its status code, request ID and text, and network failures keep theircause. - A self-hosted server's
{"error": {"message": ...}}becomes the error message, and the hosted APIs'x-llm-proxy-request-idfillsrequestId. - Requests take
signalandtimeoutoptions to cancel one request or set its own timeout. A cancelled request rejects with the signal's reason at once, including during the wait between retries, and is not retried. PassingsignalusesAbortSignal.any; requests without one work as before. - Node sends
User-Agent: valen-sdk-js/<version>;VERSIONis exported. - CommonJS can
require('@valen-team/sdk'). - System One answers are typed by
type(NoulAnswer,SystemOneChoiceAnswer,SystemOneScoreAnswer, withlegendon scores), andpredictreturnsDecisionResponseorSystemOneResponsefor those request shapes. - Releases publish from the
npm-v*tag through GitHub Actions with npm provenance.
Install
Terminal
npm install @valen-team/sdk@0.2.1