npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

kf-browser-sdk

v2.0.0

Published

Kloudfuse Browser SDK for RUM (Real User Monitoring), session replay, and log collection.

Readme

kf-browser-sdk

Kloudfuse Browser SDK for RUM (Real User Monitoring), session replay, and log collection.

Installation

ES Module (npm)

npm install kf-browser-sdk
import browserSdk from "kf-browser-sdk";

browserSdk.init({
  config: {
    applicationId: "your-application-id",
    clientToken: "your-client-token",
    env: "production",
    version: "1.0.0",
    service: "my-app",
    proxy: "https://rum.example.com",
    sessionSampleRate: 100,
    enableSessionRecording: true,
    enableLogCollection: true,
  },
});

Script Tag (CDN)

Load the bundled file via a <script> tag. The SDK is exposed as window.KfBrowserSdk.

<!-- pinned version -->
<script src="https://your-cdn.example.com/browser-sdk/kf-browser-sdk-v1.0.65.min.js"></script>

<!-- or always latest -->
<script src="https://your-cdn.example.com/browser-sdk/kf-browser-sdk.min.js"></script>

<script>
  KfBrowserSdk.init({
    config: {
      applicationId: "your-application-id",
      clientToken: "your-client-token",
      env: "production",
      version: "1.0.0",
      service: "my-app",
      proxy: "https://rum.example.com",
      sessionSampleRate: 100,
      enableSessionRecording: true,
      enableLogCollection: true,
    },
  });
</script>

Configuration

| Option | Type | Required | Default | Description | |--------|------|----------|---------|-------------| | applicationId | string | yes | | RUM application ID | | clientToken | string | yes | | Client token for authentication | | env | string | yes | | Environment name (e.g. production, staging) | | version | string | no | | Application version | | service | string | no | | Service name | | proxy | string | no | | Proxy URL for RUM data ingestion | | sessionSampleRate | number | no | | Percentage of sessions to track (0-100) | | defaultPrivacyLevel | string | no | mask-user-input | Privacy level: mask-user-input, mask, or allow | | enablePrivacyForActionName | boolean | no | false | Mask action names for privacy | | trackViewsManually | boolean | no | false | Disable automatic view tracking | | enableSessionRecording | boolean | no | false | Enable rrweb session replay | | enableLogCollection | boolean | no | false | Forward browser logs and console output | | beforeSend | function | no | | Callback to modify or discard events before they are sent |

API

Actions and Errors

// Track a custom action
browserSdk.addAction("button_clicked", { buttonId: "checkout" });

// Report an error
browserSdk.addError(new Error("Payment failed"), { orderId: "123" });

Timing and Vitals

// Add a custom timing mark
browserSdk.addTiming("hero_image_loaded");

// Duration vitals
browserSdk.addDurationVital("checkout_flow", { startTime, duration });

// Or use start/stop
browserSdk.startDurationVital("api_call");
// ... later
browserSdk.stopDurationVital("api_call");

User

browserSdk.setUser({ id: "user-123", name: "Jane", email: "[email protected]" });

Views

// Manual view tracking (requires trackViewsManually: true)
browserSdk.startView({ name: "checkout" });

Global Context

browserSdk.setGlobalContext({ team: "payments" });
browserSdk.setGlobalContextProperty("feature_flag", "new_checkout");
browserSdk.removeGlobalContextProperty("feature_flag");
browserSdk.getGlobalContext();
browserSdk.clearGlobalContext();

View Context

browserSdk.setViewContext({ page: "product_detail" });
browserSdk.setViewContextProperty("product_id", "abc-123");

Development

Build

npm run build

Outputs versioned and latest bundles to dist/:

  • dist/kf-browser-sdk-v<version>.min.js
  • dist/kf-browser-sdk.min.js

Deploy to CloudFront

  1. Copy .env.example to .env and fill in your values:
cp .env.example .env
  1. Deploy:
npm run deploy

This builds the bundle, uploads both the versioned and latest files to S3, and invalidates the CloudFront cache. If no CLOUDFRONT_DISTRIBUTION_ID is set, a new distribution will be created.

You can also run the steps individually:

npm run build   # build only
npm run push    # upload to S3 only
npm run deploy  # build + push + CloudFront invalidation

License

Apache-2.0