Skip to content

Latest commit

 

History

History
61 lines (50 loc) · 1.07 KB

README.md

File metadata and controls

61 lines (50 loc) · 1.07 KB

@initflow/event-gobbler

This package contains the event ingestion routes and the core Clickhouse logic. It can be used as a Fastify plugin or as a standalone server.

Event Schema

type ISO8601String = string;

export interface EventPayloadSchema {
  $type: "$identify";
  $event: "User Signed Up";
  $captured_at: ISO8601String;
  $user_id: string;
  $properties: DefaultProperties & {
    [key: string]: any;
  };
}

Identify Schema

type ISO8601String = string;

type UserTraits = {
  email: string;
} & (
  | {
      $firstName: string;
      $lastName: string;
    }
  | {
      $name: string;
    }
);

export interface IdentifyPayloadSchema {
  $type: "$identify";
  $captured_at: ISO8601String;
  $user_id: string;
  $properties: UserTraits &
    DefaultProperties & {
      [key: string]: any;
    };
}

Default Properties

Properties that are added to every event by the SDK.

// Default properties captured by SDK on identify/track call
type DefaultProperties = {
  $browser: string;
  $browser_version: string;
  $os: string;
  $url: string;
};