Quick Integration Guide
Get up and running with LR Shield in under 5 minutes. Follow the steps below.
02
Issue Collector Session
Generate a short-lived browser token from your backend with POST /api/collector/session.
03
Collect Securely
Use the collector session or server-side API calls without exposing the long-lived key.
SDK Code Snippets
// Server-side only: keep the long-lived API key off-browser
const axios = require('axios');
const session = await axios.post(
'https://api.lrdefender.lightningresearch.ai/api/collector/session',
{ origin: 'https://app.example.com', ttlSeconds: 120, maxUses: 3 },
{ headers: { 'X-API-Key': process.env.LR_SECRET_API_KEY } }
);
console.log(session.data.sessionToken);