SDK Integration
Build secure AI agents with 4 lines of code using the SecuriX SDK.
SDK Integration
Integrating SecuriX into your application is designed to be frictionless. Our goal is to let you focus on building features while we handle the complex security infrastructure.
Key Benefits
- 4 Lines of Code: Official SDKs for the most popular frameworks.
- No Schema Changes: Use your existing
entityId(User ID). We don't require you to store tokens or modify your database. - Managed OAuth Vaulting: We handle the entire OAuth handshake and securely vault provider tokens.
1. Install the SDK
SecuriX provides a secure handshake between your frontend and backend.
# Server-side SDK
npm install @securix/core
# Client-side SDK (React/Next.js)
npm install @securix/client2. Backend: Handshake Handler
Set up the SecuriX auth handler in your backend. In Next.js, this is literally one file.
// app/api/securix/[[...path]]/route.ts
import { toNextJsHandler } from "@securix/core";
export const { GET, POST } = toNextJsHandler;3. Frontend: The Connect Button
Drop our pre-built button into your frontend. It handles the popup flow, provider selection, and cryptographic handshake.
"use client";
import { SecurixButton } from "@securix/client";
export function Connect() {
return (
<SecurixButton
entityId="user_123" // Your existing User ID
providers={{
gmail: { scopes: ["https://www.googleapis.com/auth/gmail.readonly"] },
}}
onResult={(success) => console.log("Securely connected!")}
>
Connect Services
</SecurixButton>
);
}4. Secure API Calls
CRITICAL: Server-Side Only
The securix-api-key header must ONLY be added on the server side. Never expose your API key in client-side code, as it grants full access to your SecuriX integration.
Now you can access user data using any official provider SDK by pointing it to the SecuriX Proxy. Your server never handles raw provider tokens.
import { google } from "googleapis";
const gmail = google.gmail({
version: "v1",
rootUrl: "https://gmail.api.securix.app", // SecuriX Secure Proxy
headers: {
"securix-api-key": process.env.SECURIX_API_KEY,
"securix-entity-id": "user_123",
"securix-agent-id": "gemini_vscode_1",
},
});That's it. You've integrated enterprise-grade security with zero infrastructure overhead.