open-index/open-npm huggingface dataset:
npm package: @talkfurther/events
Description: Shared analytics event definitions used across Further's products. Each event is defined with a [zod](https://zod.dev/) schema that documents its fields, types, and descriptions.
Latest version: 0.2.0

# @talkfurther/events

Shared analytics event definitions used across Further's products. Each event is defined with a [zod](https://zod.dev/) schema that documents its fields, types, and descriptions.

If you are looking for event documentation please see Analytics Profiles in Further Dashboard settings.

## Usage

```typescript
import { analyticsEvents, getEventFields } from "@talkfurther/events";
import type { AnalyticsEventName, AnalyticsEventData } from "@talkfurther/events";

// Access an event definition
const event = analyticsEvents.form_submitted;
console.log(event.defaultName); // "further.form_submitted"
console.log(event.description); // "Fired when a form is successfully submitted"

// Validate event data against the schema
const result = event.schema.safeParse(data);

// Get field metadata (used by the dashboard to render event docs)
const fields = getEventFields("form_submitted");
// [{ name: "formId", description: "...", required: true }, ...]
```

## Adding a new event

1. Define the event in `events.ts` with a `defaultName`, `description`, and zod `schema`
2. Use `.describe()` on each field — these descriptions are shown in the dashboard profile editor
3. Rebuild: `npm run build`

## Building

```
npm run build    # one-time build with microbundle
npm run dev      # watch mode
```