Usage Tracking Demo
This demo shows how to track usage events with Usagey. Fill out the form below to send a usage event.
Track Usage Event
Result
Submit the form to see the result
How It Works
This demo uses the Usagey SDK to track usage events. The implementation follows these steps:
- Import the
trackEvent
function from our client library - Collect event details through a form (event type, quantity, metadata)
- Call
trackEvent()
with the provided parameters - Display the API response, which includes confirmation and usage statistics
Code Example
import { trackEvent } from '@/lib/usagey-client'; // Track a usage event const result = await trackEvent( 'api_call', // Event type 1, // Quantity { // Metadata (optional) endpoint: '/users', method: 'GET' } );