Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

528 B
Raw Blame
export class ImportError extends Error {
  constructor(message: string) {
    super(message)
    this.name = 'ImportError'
  }
}

export interface AnalyticsImportRow {
  type: 'pageview' | 'custom_event' | 'outbound'
  data: Record<string, unknown>
}

export interface ImportMapper {
  readonly provider: string
  readonly expectedFileExtension: string | null

  createRowStream(
    filePath: string | null,
    pid: string,
    importID: number,
    context?: Record<string, unknown>,
  ): AsyncIterable<AnalyticsImportRow>
}