How to install the ClearRun SDK
Run npm install @clearrun/sdk. It works in Node.js 18 or newer. You can start in mock mode with no key, then add a key for real scores.
Last updated
Steps
Install
npm install @clearrun/sdkTry it with no key
import { createKernelClient } from '@clearrun/sdk'; const client = createKernelClient({ forceMock: true }); const { verdict } = await client.score({ responseText: 'Our API never stores customer data.' }); console.log(verdict.score, verdict.summary);This is a mock score. It is not a real evaluation.
Switch to real scores
Remove
forceMockand setCLEARRUN_API_KEY. See How to create a ClearRun client (createKernelClient).
Types
TypeScript types ship with the package. The shared verdict types come from @clearrun/core-types, which installs with it.