1.0.18 • Published 12 months ago
@userloop/api v1.0.18
Userloop
A TypeScript/JavaScript client for the Userloop API.
Installation
npm install @userloop/api
Usage
import Userloop from 'userloop';
const userloop = new Userloop('your-api-key');
// Emit an event
userloop
.emit('event_id', { key: 'value' })
.then((response) => console.log(response))
.catch((error) => console.error(error));
API
Userloop(apiKey: string)
Creates a new Userloop instance.
emit(id: string, data?: Record<string, any>): Promise<any>
Emits an event to the Userloop API.
id
: The event identifier.data
: Optional data associated with the event.
Returns a promise that resolves to the API response.