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

@kubesense/kubesense-browser-core

v1.4.0

Published

Core utilities shared across the Kubesense Browser SDK (session management, transport, configuration, and context).

Readme

@kubesense/kubesense-browser-core

Foundation utilities shared across the Kubesense Browser SDK: session management, transport and batching, configuration, context managers, telemetry, and browser helpers.

Internal package. This is a building block consumed by the other Kubesense Browser SDK packages — it is not a product SDK on its own and has no standalone initialization. You normally do not install it directly.

To instrument your application, use one of:

Geolocation

The SDK provides utilities to collect user geolocation data using the browser's Geolocation API.

Note: Collecting geolocation requires explicit user permission. The browser will prompt the user to allow location access.

API

import { canUseGeoLocation, getCurrentPosition, watchPosition, clearWatch } from '@kubesense/kubesense-browser-core'

// Check if geolocation is supported
if (canUseGeoLocation()) {
  // Get position once
  getCurrentPosition(
    (position) => {
      console.log(position.latitude, position.longitude, position.accuracy)
    },
    (error) => {
      console.error(error.message)
    },
    { enableHighAccuracy: true, timeout: 10000 }
  )

  // Or watch position continuously
  const watchId = watchPosition(
    (position) => {
      console.log(position.latitude, position.longitude)
    },
    (error) => {
      console.error(error.message)
    }
  )

  // Stop watching
  clearWatch(watchId)
}

Using with RUM

Add location data to all RUM events via global context:

import { getCurrentPosition, canUseGeoLocation } from '@kubesense/kubesense-browser-core'
import { kubsenseRum } from '@kubesense/kubesense-browser-rum'

if (canUseGeoLocation()) {
  getCurrentPosition((position) => {
    kubsenseRum.setGlobalContextProperty('geo', {
      latitude: position.latitude,
      longitude: position.longitude,
      accuracy: position.accuracy,
    })
  })
}

Or use the beforeSend hook to add location to individual events:

kubsenseRum.init({
  beforeSend: (event) => {
    if (canUseGeoLocation()) {
      getCurrentPosition(
        (position) => {
          event.context.geo = {
            latitude: position.latitude,
            longitude: position.longitude,
          }
        },
        () => {} // Ignore errors
      )
    }
  }
})

Reverse Geocoding

Convert coordinates to location names (city, country, etc.) using reverse geocoding:

import { getCurrentPosition, reverseGeocodeWithPosition, getLocationName } from '@kubesense/kubesense-browser-core'

getCurrentPosition((position) => {
  reverseGeocodeWithPosition(position, (result) => {
    console.log(result.city)      // "San Francisco"
    console.log(result.state)     // "California"
    console.log(result.country)   // "United States of America"
    console.log(getLocationName(result)) // "San Francisco, California, United States of America"
  })
})

API

// Sync callback style
reverseGeocode(lat, lon, onSuccess, onError)

// Async style
const result = await reverseGeocodeAsync(lat, lon)

// With position object
reverseGeocodeWithPosition(position, onSuccess, onError)
const result = await reverseGeocodeWithPositionAsync(position)

Response Type

interface GeoLocationResult {
  city?: string           // "San Francisco"
  state?: string          // "California"
  stateCode?: string      // "CA"
  country?: string        // "United States of America"
  countryCode?: string    // "US"
  continent?: string      // "North America"
  timezone?: string       // "America/Los_Angeles"
  locality?: string       // Neighborhood or suburb
  postalCode?: string     // "94102"
  raw?: GeocodingResponse // Raw API response
}

Note: By default, this uses OpenStreetMap's Nominatim API (free, no API key required). You can provide your own baseUrl for other geocoding services.

License

Apache-2.0