API

Log Event

The `logEvent` method allows you to send events to your CapHog project.

Prerequisites

Please ensure you have initialized the CapHog SDK in your project by calling the initialize method with your project ID.

Usage

import { CapHog } from '@caphog/sdk'

CapHog.logEvent({ eventName: 'your-event-name', payload: { key: 'value' } })

Replace 'your-event-name' with the name of the event you want to log.

Parameters

  • eventName (string, required): The name of the event to log. This should match an event defined in your CapHog project.
  • payload (object, optional): An optional object containing additional data to send with the event.

Copyright © 2025