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.
type ISO8601String = string;
export interface EventPayloadSchema {
$type: "$identify";
$event: "User Signed Up";
$captured_at: ISO8601String;
$user_id: string;
$properties: DefaultProperties & {
[key: string]: any;
};
}
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;
};
}
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;
};