# Installation
Install the SolonGate SDK for TypeScript or use the proxy CLI directly.
Prerequisites: Make sure you have Node.js v18+ installed. See Prerequisites for details.
TypeScript SDK
bash
1npm install @solongate/proxy@latest
Basic Usage
typescript
1import { SolonGate } from '@solongate/proxy';23// Initialize — reads SOLONGATE_API_KEY from .env automatically4const gate = new SolonGate({ name: 'my-app' });56// Validate a tool call7const result = await gate.executeToolCall(8 { name: 'file_read', arguments: { path: '/data/doc.txt' } },9 async () => ({ content: [{ type: 'text', text: '...' }] }),10);1112console.log(result); // tool result or policy denial
Package Exports
typescript
1import {2 SolonGate, // Security gateway wrapper3 PolicyEngine, // Policy evaluation4 TrustLevel, // UNTRUSTED | VERIFIED | TRUSTED5 Permission, // READ | WRITE | EXECUTE6 RateLimiter, // Token-bucket rate limiting7 TokenIssuer, // Capability tokens8 ServerVerifier, // Request verification9} from '@solongate/proxy';
Environment Setup
Create a .env file in your project root:
bash
1# .env2# Get your keys from: https://dashboard.solongate.com → Projects → API Keys3# IMPORTANT: Never commit this file to git!45# Live key — connects to api.solongate.com for policy sync + audit logging6SOLONGATE_API_KEY=sg_live_your_key_here78# Test key — offline mode, no API connection (for development)9# SOLONGATE_API_KEY=sg_test_your_key_here
Tip: If you use npx @solongate/proxy@latest init, a .env file is created automatically with placeholder keys.
Security Proxy (No SDK Required)
If you just want to protect existing AI tools without writing code, use the proxy instead:
bash
1# Protect all AI tools — no code changes needed2npx @solongate/proxy@latest init --all
AI Tool Flags
By default, hooks are installed for all supported AI tools. Use flags to target specific ones:
bash
1npx @solongate/proxy@latest init --all --claude-code --gemini
--claude-code--gemini--openclaw
See Policies documentation and Quick Start for details.