ChatBotKit Node SDK
    Preparing search index...

    Report client for generating analytics reports.

    This client provides access to ChatBotKit's reporting system, which offers various types of reports for analyzing conversations, usage, performance metrics, and other platform data. Reports are identified by unique report IDs, which can be discovered using the platform.report.list() method. Each report may have different input parameters and output formats depending on the specific analytics it provides.

    const client = new ReportClient({ secret: 'your-secret' })

    // First, discover available reports
    const reports = await client.platform.report.list()

    // Then generate a specific report using its ID
    const report = await client.generate('clr3m5n8k000508jq2j9k0l6f', {
    periodDays: 30
    })

    console.log(`Total conversations: ${report.value}`)
    // Using typed reports for full type safety with total ratings
    const report = await client.generateTyped('clr3m5n8k000008jq7h9e5b1a', {
    periodDays: 7
    })

    console.log(`Thumbs up: ${report.thumbsUp}, Thumbs down: ${report.thumbsDown}`)

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Creates a new instance of the same client type with extended options.

      This is useful when you need to create a client with modified configuration (e.g., different endpoint, token, or headers) without affecting the original.

      Note: This method creates a completely new instance rather than cloning, which is necessary because private class fields cannot be copied.

      Parameters

      Returns ReportClient

      A new instance of the same client class with extended options

    • Generates a report.

      Parameters

      • reportId: string
      • request: { [key: string]: unknown }

      Returns Promise<Record<string, never>>

    • Generates a typed report with full type safety for input and output.

      Type Parameters

      • T extends ReportId

      Parameters

      • reportId: T

        The report ID

      • request: ReportInputTypes[T]

        The report input

      Returns Promise<ReportOutputTypes[T]>