JavaScript SDK

Overview

The LockLLM JavaScript SDK is currently in development. This native JavaScript/TypeScript library will provide first-class support for both Node.js and browser environments, offering modern JavaScript patterns and comprehensive TypeScript definitions for the best developer experience.

Coming Soon

The JavaScript SDK is under active development. We are building a library that works seamlessly in both server-side Node.js applications and client-side browser environments, with full TypeScript support and tree-shaking optimization.

Planned Features

  • TypeScript First: Complete TypeScript definitions with full type inference
  • Universal Support: Works in Node.js, browsers, Edge runtimes
  • Modern JavaScript: ESM and CommonJS support, tree-shakeable
  • Promise-Based: Async/await patterns throughout
  • Zero Dependencies: Minimal footprint, no external dependencies
  • Framework Agnostic: Works with Next.js, React, Vue, Express, Fastify
  • Middleware Support: Express, Koa, and Next.js middleware
  • Bundle Optimized: Small bundle size with tree-shaking

Planned Usage

The SDK will offer intuitive APIs for JavaScript developers:

import { LockLLM } from 'lockllm'

// Initialize client
const client = new LockLLM({ apiKey: 'your-api-key' })

// Scan a prompt
const result = await client.scan(userInput)
if (result.isSafe) {
  // Safe to use with LLM
  const response = await llm.generate(userInput)
}

// Or use middleware in Express
app.use(client.middleware())

// TypeScript gets full type inference
const { isSafe, threats }: ScanResult = await client.scan(prompt)

Use Cases

Once available, the JavaScript SDK will be ideal for:

  • Next.js applications with AI features
  • Express or Fastify API servers
  • React applications with client-side LLM calls
  • Serverless functions (Vercel, Netlify, Cloudflare Workers)
  • Browser-based chatbots and AI interfaces
  • Node.js microservices with LLM integration

Current Alternative

While the JavaScript SDK is in development, JavaScript developers can use the REST API or proxy integration for immediate prompt security needs. The REST API provides full functionality accessible from any JavaScript environment.

Get Notified

Sign up in the dashboard to receive notifications when the JavaScript SDK launches. Documentation for the JavaScript SDK is coming soon with updates on development progress and planned release timeline.