
Security News
/Company News
Securing the Financial Frontier: How Capital One Uses Socket for Open Source Security
Capital One is partnering with Socket to proactively secure its open source supply chain.
openpanel-miniprogram
Advanced tools
OpenPanel SDK for WeChat Mini Programs. Zero external runtime dependencies.
npm install openpanel-miniprogram
// app.ts
import { OpenPanel } from 'openpanel-miniprogram';
const op = new OpenPanel({
clientId: 'YOUR_CLIENT_ID',
clientSecret: 'YOUR_CLIENT_SECRET', // required for self-hosted instances
apiUrl: 'https://your-instance.com/api', // default: https://api.openpanel.dev
});
App({
onLaunch() {
// identify user when ready
op.identify({ profileId: 'user-123', firstName: 'Alice' });
},
logout() {
op.clear();
},
});
// pages/index/index.ts
import { op } from '~/app';
Page({
onTap() {
op.track('button_click', { button: 'buy_now' });
},
});
interface MiniprogramOpenPanelOptions {
clientId: string; // Required
clientSecret?: string; // Required for self-hosted instances
apiUrl?: string; // Default: https://api.openpanel.dev
requestAdapter?: WxRequestAdapter; // Default: wx
storageAdapter?: StorageAdapter; // Default: wx.getStorageSync/setStorageSync
waitForProfile?: boolean; // Queue events until identify() is called
filter?: (payload) => boolean; // Filter events before sending
disabled?: boolean; // Disable all tracking
debug?: boolean; // Log to console
}
op.track(name, properties?)
op.screenView(pagePath, properties?) // shorthand for track('screen_view', { __path: pagePath })
op.revenue(amount, properties?) // shorthand for track('revenue', { __revenue: amount })
op.identify({ profileId, firstName?, lastName?, email?, avatar?, properties? })
op.clear() // clear user identity, groups, device/session IDs
op.setGroup(groupId) // add user to a group
op.setGroups(groupIds) // add user to multiple groups
op.upsertGroup({ id, type, name, properties? }) // create/update a group
op.increment({ profileId, property, value? })
op.decrement({ profileId, property, value? })
op.setGlobalProperties({ key: 'value' }) // merged into every event
op.ready() // enable SDK + flush queued events
op.flush() // manually flush offline queue
op.destroy() // cleanup network listeners
op.getDeviceId() // get persisted device ID
op.getSessionId() // get persisted session ID
Automatically track screen_view on every Page.onShow and app_show/app_hide on App:
import { OpenPanel, installAutoTracking } from 'openpanel-miniprogram';
const op = new OpenPanel({ clientId: 'YOUR_CLIENT_ID' });
installAutoTracking(op);
Events are automatically queued when the device is offline and flushed when connectivity returns. The queue is persisted to wx.storage so events survive app restarts.
wx.request via configurable adapterwx.storage__platform, __os, __model, __system, __screen, __wxVersion, __sdkVersionMIT
FAQs
OpenPanel SDK for WeChat Mini Programs
The npm package openpanel-miniprogram receives a total of 19 weekly downloads. As such, openpanel-miniprogram popularity was classified as not popular.
We found that openpanel-miniprogram 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.

Security News
/Company News
Capital One is partnering with Socket to proactively secure its open source supply chain.

Security News
Socket CTO Ahmad Nassri discusses how to keep AI agents from bypassing package blocks, limit credential access, and monitor their actions.

Security News
GPT-6 Astra tried to plant malicious code in simulated open source projects using fake GitHub accounts and deceptive PRs during an assigned CTF challenge.