Skip to content

API Reference

Available Packages

Overseer provides two SDK packages:

  • @overseerai/sdk - Node.js SDK
  • @overseerai/sdk-typescript - TypeScript SDK with type safety

Installation

Terminal window
npm install @overseerai/sdk

Overseer Class

The main class for interacting with the Overseer SDK.

Constructor

constructor(config: { apiKey: string })

Parameters

ParameterTypeRequiredDescription
apiKeystringYesYour system-specific API key from the connections page in the dashboard

Methods

validate

async validate(content: string): Promise<ValidationResult>

Validates the safety of a piece of content.

ValidationResult
PropertyTypeDescription
isAllowedbooleanWhether the content is safe
textstringThe validated content
detailsobjectAdditional details about validation result
details.reasonstringReason for rejection if content is not allowed

Example Usage

import { Overseer } from '@overseerai/sdk';
// Initialize the client
const overseer = new Overseer({
apiKey: 'your-api-key' // From connections page in dashboard
});
// Validate content
try {
const result = await overseer.validate('Hello! How can I help you today?');
if (result.isAllowed) {
console.log('Content is safe:', result.text);
} else {
console.log('Content was rejected:', result.text);
console.log('Reason:', result.details?.reason);
}
} catch (error) {
console.error('Error validating content:', error);
}

Environment Variables

NameRequiredDescription
API_KEYYesYour system-specific API key from the connections page in the dashboard