Skip to content

Quick Integration Guide

Get up and running with LR Shield in under 5 minutes. Follow the steps below.

01

Store Secret Server-Side

Keep your long-lived API key in env or a secret manager.

Create Account
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.

04

Monitor

Visit your dashboard to monitor usage and tune thresholds.

Open Dashboard

SDK Code Snippets

<script src="https://lrdefender.lightningresearch.ai/sdk/v1/lr.min.js"></script>
<script>
  // Fetch this session token from your own backend. Do not hard-code secrets in the page.
  const sessionToken = await fetch('/api/collector/session', { method: 'POST' })
    .then((res) => res.json())
    .then(({ sessionToken }) => sessionToken);
  const client = new LightningResearchSDK.LightningResearch({ sessionToken, endpoint: 'https://api.lrdefender.lightningresearch.ai' });
  client.identify().then(result => console.log(result.deviceId));
</script>