Create an API key from the dashboard and set it as an environment variable:
export CENTURE_API_KEY="your-api-key"
3
Scan text content
import { CentureClient } from "@centure/node-sdk";const client = new CentureClient();// Fetch text from a URL and scan itconst text = await fetch('https://example.com').then(r => r.text());const result = await client.scanText(text);if (!result.is_safe) { console.log("Prompt injection detected!"); console.log("Threats:", result.categories);} else { console.log("Content is safe");}
The SDK automatically reads the CENTURE_API_KEY environment variable if you don’t provide an API key explicitly.