@centure/node-sdk package provides type-safe TypeScript support for detecting prompt injection attacks in your Node.js applications.
Installation
1
Install the package
Install the SDK using your preferred package manager:
2
Get your API key
Obtain your API key from the Centure dashboard. Store it securely in your environment variables.
Never commit API keys to version control. Use environment variables or a secrets manager.
3
Initialize the client
Create a client instance with your API key:
Scan Text Content
Detect prompt injection attempts in text messages, user inputs, or prompts:Response Example
Scan Images
Detect text-based prompt injection in images using base64 encoding or Buffer objects:- Base64 String
- Buffer (Node.js)
The SDK automatically converts Buffer objects to base64 format for transmission.
Error Handling
Handle specific error scenarios with typed error classes:Next Steps
API Reference
Explore response types, threat categories, and advanced configuration options
MCP Integration
Secure Model Context Protocol applications with automatic scanning
npm Package
View package details and version history on npm
GitHub Repository
View source code, report issues, and contribute

