
Company News
Meet the Socket Team at RSAC and BSidesSF 2026
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.
@openpanel/sdk
Advanced tools
The OpenPanel Web SDK allows you to track user behavior on your website using a simple script tag. This guide provides instructions for installing and using the Web SDK in your project.
The OpenPanel Web SDK allows you to track user behavior on your website using a simple script tag. This guide provides instructions for installing and using the Web SDK in your project.
📖 Full documentation: https://openpanel.dev/docs/sdks/sdk
npm install @openpanel/sdk
import { OpenPanel } from '@openpanel/sdk';
const op = new OpenPanel({
clientId: 'YOUR_CLIENT_ID',
clientSecret: 'YOUR_CLIENT_SECRET',
});
apiUrl - The url of the openpanel API or your self-hosted instanceclientId - The client id of your applicationclientSecret - The client secret of your application (only required for server-side events)filter - A function that will be called before sending an event. If it returns false, the event will not be sentdisabled - If true, the library will not send any eventsimport { op } from './op.js';
op.track('my_event', { foo: 'bar' });
You can track events with two different methods: by calling the op.track( directly or by adding data-track` attributes to your HTML elements.
import { op } from './op.ts';
op.track('my_event', { foo: 'bar' });
To identify a user, call the `op.identify( method with a unique identifier.
import { op } from './op.ts';
op.identify({
profileId: '123', // Required
firstName: 'Joe',
lastName: 'Doe',
email: 'joe@doe.com',
properties: {
tier: 'premium',
},
});
To set properties that will be sent with every event:
import { op } from './op.ts'
op.setGlobalProperties({
app_version: '1.0.2',
environment: 'production',
});
To increment a numeric property on a user profile.
value is the amount to increment the property by. If not provided, the property will be incremented by 1.import { op } from './op.ts'
op.increment({
profileId: '1',
property: 'visits',
value: 1 // optional
});
To decrement a numeric property on a user profile.
value is the amount to decrement the property by. If not provided, the property will be decremented by 1.import { op } from './op.ts'
op.decrement({
profileId: '1',
property: 'visits',
value: 1 // optional
});
To clear the current user's data:
import { op } from './op.ts'
op.clear()
FAQs
The OpenPanel Web SDK allows you to track user behavior on your website using a simple script tag. This guide provides instructions for installing and using the Web SDK in your project.
The npm package @openpanel/sdk receives a total of 27,163 weekly downloads. As such, @openpanel/sdk popularity was classified as popular.
We found that @openpanel/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.

Research
/Security News
Malicious Packagist packages disguised as Laravel utilities install an encrypted PHP RAT via Composer dependencies, enabling remote access and C2 callbacks.

Research
/Security News
OpenVSX releases of Aqua Trivy 1.8.12 and 1.8.13 contained injected natural-language prompts that abuse local AI coding agents for system inspection and potential data exfiltration.