
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@clipboard-health/analytics
Advanced tools
Type-safe analytics wrapper around our third-party analytics provider for user identification and event tracking.
Type-safe analytics wrapper around our third-party analytics provider for user identification and event tracking.
npm install @clipboard-health/analytics
import { Analytics } from "@clipboard-health/analytics";
const logger = {
info: console.log,
warn: console.warn,
error: console.error,
};
{
// Basic usage with both features enabled
const analytics = new Analytics({
apiKey: "your-segment-write-key",
logger,
enabled: { identify: true, track: true },
});
// Identify a user
analytics.identify({
userId: "user-123",
traits: {
email: "user@example.com",
name: "John Doe",
createdAt: new Date("2023-01-01"),
type: "worker",
},
});
// Track an event
analytics.track({
userId: "user-123",
event: "Button Clicked",
traits: {
buttonName: "Apply",
page: "home",
plan: "worker",
},
});
}
{
// Disabled analytics example
const analytics = new Analytics({
apiKey: "your-segment-write-key",
logger,
enabled: { identify: false, track: false },
});
// These calls will be logged but not sent to Segment
analytics.identify({
userId: "user-789",
traits: { email: "test@example.com" },
});
analytics.track({
userId: "user-789",
event: "Page View",
traits: { page: "home" },
});
}
See package.json scripts for a list of commands.
FAQs
Type-safe analytics wrapper around our third-party analytics provider for user identification and event tracking.
We found that @clipboard-health/analytics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.