• Records an Analytic event to Pinpoint. Events will be buffered and periodically sent to Pinpoint.

    Parameters

    Returns void

    Deprecated

    AWS will end support for Amazon Pinpoint on October 30, 2026.

    Throws

    validation: AnalyticsValidationErrorCode - Thrown when the provided parameters or library configuration is incorrect.

    Example

    // Send an event to Pinpoint
    record({ name: eventName })

    Example

    // Send an event to Pinpoint with metrics & custom attributes
    record({
    name: eventName,
    attributes: {
    'my-attribute': attributeValue
    },
    metrics: {
    'my-metric': metricValue
    }
    })