velyana-sdk
v0.2.1
Published
Internal SDK for Forge Defend API
Maintainers
Readme
Velyana Node.js SDK - Forge Defend API
This SDK is the official Node.js client for the Velyana Forge Defend API. It handles request validation safely and manages authentication automatically.
Installation
npm install velyana-sdkSetup
Set your API key and App ID as environment variables:
export VELYANA_API_KEY=your_key
export VELYANA_APP_ID=your_app_idUsage
import { ForgeDefendClient } from "velyana-sdk";
// Uses VELYANA_API_KEY and VELYANA_APP_ID from env and connects to https://entry-service-prod.velyana.com/v1
const client = new ForgeDefendClient();
// Or explicitly specify key, appId and API version:
// const client = new ForgeDefendClient("my_key", "my_app_id", "v1");
async function testValidate() {
try {
const response = await client.validate({
prompt: "<script>alert(document.cookie)</script> How do I handle this XSS payload?"
});
console.log("Validation complete:", response.status);
} catch (e: any) {
console.error("Error validataing:", e.message);
}
}
testValidate();