Docs

Setup & Installation

Get the Insights SDK running in under 2 minutes

Last updated:

Installation

npm / ES Module

npm install @sessionsight/insights

Then initialize in your app:

Initialize
import SessionSight from '@sessionsight/insights';

SessionSight.init({
  publicApiKey: 'YOUR_PUBLIC_API_KEY',
  propertyId: 'YOUR_PROPERTY_ID',
});

Script Tag

If you’re not using a bundler, add the script tag directly:

Script tag
<!-- SessionSight · sessionsight.com -->
<!-- Paste this just before </head> on every page you want to track. -->
<script>
    (function sessionsight(w,i,n,s){
        var q=w._ssq=[],p=P=>new Proxy(function(){},{
            get:(_,k)=>k=='then'||typeof k=='symbol'?void 0:p(P.concat(k)),
            apply:(_,__,a)=>new Promise((rs,rj)=>q.push({p:P,a,rs,rj}))
        });
        w.SessionSight=p([]);
        var e=i.createElement('script');e.async=1;e.src=n;i.head.appendChild(e);
        w.SessionSight.init(s);
    })(window,document,'https://cdn.sessionsight.com/sessionsight.js',{
        publicApiKey:'YOUR_PUBLIC_API_KEY',
        propertyId:'YOUR_PROPERTY_ID'
    });
</script>

Configuration

OptionTypeDefaultDescription
publicApiKeystringrequiredYour public API key from the API Keys page
propertyIdstring'dev'Your property ID from the Properties page. Defaults to 'dev' for localhost development
apiUrlstringhttps://api.sessionsight.comOverride for self-hosted or local dev
autoRecordbooleantrueStart recording immediately on init
consent'anonymous' \| 'full' \| boolean \| (() => 'anonymous' \| 'full' \| boolean)'full'Which tier the SDK runs in. 'anonymous' (or legacy false) captures aggregate counters with no cookies or replay; 'full' (or legacy true) captures identified sessions with replay. Pass a function for reactive consent (polled every second). See Consent
honorConsentModebooleanfalseOpt into Google Consent Mode v2 auto-wiring. When true, the SDK reads analytics_storage at init and observes gtag('consent', 'update', ...) calls. See Consent

For framework-specific examples (React, SvelteKit, Vue, Angular), see the Framework Guides.

Verify It’s Working

After adding the SDK:

  1. Open your site in a browser
  2. Navigate around for a few seconds
  3. Go to your SessionSight dashboard and open Live View
  4. You should see your session appear in real-time

If you don’t see it, check the browser console for errors. The most common issues are an incorrect API key or property ID.