Installation
Add Sentinel SDK to your TypeScript project
2 min read
Installation
Requirements
- Node.js
>=20.0.0 - TypeScript
>=5.7
Install the Core Package
npm install @sentinel-sdk/core
pnpm add @sentinel-sdk/core
yarn add @sentinel-sdk/core
Install the CLI (optional)
The CLI lets you scan inputs and simulate transactions from the terminal without writing code.
npm install -g @sentinel-sdk/cli
Verify the installation:
sentinel --version
Peer Dependencies
@sentinel-sdk/core has no required peer dependencies. The LLM judge feature requires an API key for your chosen provider (Anthropic, OpenAI, or a custom endpoint), which you supply via config — not as an npm dependency.
TypeScript Configuration
Sentinel is written with strict TypeScript and ships full .d.ts types. No additional @types packages are needed.
Ensure your tsconfig.json includes:
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true
}
}
Environment Variables
If you configure the LLM judge via apiKeyEnvVar, set the corresponding variable before running your agent:
# For Anthropic
export ANTHROPIC_API_KEY=sk-ant-...
# For OpenAI
export OPENAI_API_KEY=sk-...
Prefer apiKeyEnvVar over apiKey
Use apiKeyEnvVar in your SentinelConfig rather than inlining the API key. This keeps credentials out of source code and lets you rotate keys without redeploying.
Verify Installation
import { Sentinel } from '@sentinel-sdk/core';
const sentinel = await Sentinel.create({
mode: 'guard-only',
promptGuard: {
mode: 'rules',
},
});
const result = await sentinel.scanInput('hello world');
console.log(result.safe); // true
Next Steps
- Quick Start — your first end-to-end integration
- Configuration — full config reference