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

questera-raw-event-sdk

v1.0.0

Published

A JavaScript SDK for tracking events and user behavior

Downloads

6

Readme

Questera Raw Event SDK

A comprehensive web raw event SDK for tracking user interactions, page views, and custom events with automatic browser and device detection.

Features

  • 🔄 Automatic Event Tracking: Clicks, page views, form interactions, and navigation
  • 🌍 Geographic Detection: Automatic location detection with fallback handling
  • 🖥️ Device & Browser Detection: Comprehensive browser, OS, and device type identification
  • 📱 Responsive Tracking: Window size and device type monitoring
  • 🔒 Privacy-First: Local storage with cookie fallback for user identification
  • 🔄 Queue Management: Built-in API request queuing and retry logic
  • 👤 User Identity Management: Associate events with specific users
  • 📊 Session Management: Automatic session tracking and management

API Reference

Core Methods

questera.init()

Initializes the SDK, sets up event listeners, and tracks the initial page view.

questera.identify(userId, properties)

Associate current session with a specific user ID and optional user properties.

Tracking Control

questera.startTracking()

Enable event tracking (enabled by default).

questera.stopTracking()

Disable event tracking.

questera.resetIdentity()

Clear current user identity and generate new anonymous user.

Event Properties

questera.addEventProperties(properties)

Add properties that will be included with all future events.

questera.removeEventProperty(property)

Remove a specific event property.

questera.clearEventProperties()

Clear all event properties.

Page View Tracking

questera.trackPageview(path)

Manually track a page view.

questera.addPageviewProperties(properties)

Add properties to all page view events.

questera.removePageviewProperty(property)

Remove a specific pageview property.

questera.clearPageviewProperties()

Clear all pageview properties.

Manual Event Tracking

questera.trackClick(selector, properties)

Manually track click events.

questera.trackEntry(selector, value, properties)

Track form field entries.

questera.trackSelect(selector, value, properties)

Track select dropdown changes.

Utility Methods

questera.getUserId()

Get current user ID.

questera.getSessionId()

Get current session ID.

questera.getIdentity()

Get complete identity information (returns: { userId, sessionId, userProperties }).

questera.onReady(callback)

Execute callback when SDK is ready.

Automatic Tracking

What Gets Tracked Automatically

  1. Page Views: Navigation, history changes, and initial page loads
  2. Clicks: Interactive elements (buttons, links, clickable elements)
  3. Form Interactions:
    • Text input and textarea entries (on blur)
    • Select dropdown changes
    • Radio button selections
  4. Session Management: Automatic session creation and cleanup

Smart Element Detection

The SDK automatically identifies trackable elements based on:

  • Interactive tags (button, a)
  • Elements with click handlers
  • Elements with cursor: pointer CSS
  • Elements with tabindex attribute
  • Elements with ARIA roles (button, link)
  • Elements with data-track-id attributes

Data Collection

Each event automatically includes:

  • Browser Information: Name and version
  • Device Details: Type (Desktop/Mobile/Tablet) and platform
  • Geographic Data: City, region, country, currency
  • Page Context: URL, title, referrer, hash
  • Window Information: Dimensions and viewport data
  • User Context: Session ID, user ID (if identified)
  • Element Context: CSS selectors, text content, data attributes

Data Attributes

data-track-id

Add this attribute to elements for better tracking identification. The tracking data will include this ID for easier event identification.

Privacy & Storage

  • User IDs: Stored in localStorage with cookie fallback
  • Session IDs: Stored in sessionStorage with cookie fallback
  • Geographic Data: Cached locally to reduce API calls
  • Cookie Expiration: 365 days for persistent data
  • Session Cleanup: Session cookies cleared on page unload

Error Handling

The SDK includes built-in error handling for:

  • Network failures
  • API errors
  • Geographic detection failures
  • Queue processing errors

Browser Support

  • Modern browsers with ES6+ support
  • Chrome, Firefox, Safari, Edge
  • Mobile browsers (iOS Safari, Chrome Mobile)
  • Requires crypto.getRandomValues() for UUID generation

Troubleshooting

Events Not Showing Up

  1. Check API key and entity ID are correct
  2. Verify network connectivity to API endpoints
  3. Check browser console for error messages
  4. Ensure tracking is enabled: questera.startTracking()

Geographic Detection Issues

  • The SDK will fall back to "Unknown" values if geographic API fails
  • Geographic data is cached locally after first successful request

Element Not Being Tracked

  • Ensure element has interactive properties (click handler, cursor: pointer, etc.)
  • Add data-track-id attribute for better identification
  • Check if element has useful data (text content, classes, etc.)