Skip to content

CounterAPI JavaScript Client

The CounterAPI JavaScript client is a lightweight, universal library that provides an easy way to interact with the CounterAPI service. This library allows you to track page views, user interactions, and other countable events in your web applications without requiring a backend server.

Features

  • Universal JavaScript Support: Works in Node.js, browsers, and supports ESM modules
  • Version Support: Compatible with both v1 and v2 CounterAPI endpoints
  • Promise-based API: Modern asynchronous interface
  • TypeScript Support: Full type definitions included
  • Error Handling: Comprehensive error management
  • Debugging Mode: Optional logging for troubleshooting
  • Lightweight: Minimal footprint for your applications
  • Authentication: Secure your counters with API tokens (V2 API only)

Installation

npm install counterapi

Documentation Sections

Repository

For source code, issues, and contributions, visit the Counter API JavaScript Library repository on GitHub.