Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Better Auth · Const

anonymous

The anonymous identifier is a non-reversible hash derived from the project’s package.json name and optionally its baseURL. Better Auth uses it to de-duplicate telemetry events per project without identifying users.

Since
v1.3.5

How it works

Better Auth creates an anonymous identifier as a non-reversible hash derived from the project’s package.json name and, optionally, its baseURL. It uses this value to de-duplicate telemetry events by project without identifying the user.

Syntax

anonymous identifier: hash(package.json.name, baseURL?)

Returns

A non-reversible project-derived hash used to de-duplicate telemetry events.

Key points

  • The identifier is computed as a one-way project-derived hash using the package name and optional base URL.
  • Its operational purpose is grouping telemetry events by project rather than identifying individual users.
  • The documentation frames the telemetry system as anonymous and privacy-oriented.
  • The identifier contributes to aggregate usage analysis, not user-level profiling.
  • Telemetry does not transmit the complete authentication configuration.

Common mistakes

  • Telemetry must be explicitly enabled; it is not collected by default.
  • The anonymous identifier does not mean that arbitrary authentication or secret data is sent.

Example: Enable anonymous telemetry identifier

import { betterAuth } from "better-auth"
import { getTelemetryAuthConfig } from "better-auth/telemetry"

export const auth = betterAuth({
  telemetry: {
    enabled: true,
    authConfig: getTelemetryAuthConfig(),
  },
})

Enables telemetry; Better Auth derives the project’s anonymous identifier from the package name and optional base URL.

When to use it

Project-level telemetry aggregation

Group anonymous usage events from one application without sending its project name directly.

Event de-duplication

Distinguish repeated events from separate applications while keeping the collected value non-reversible.

Privacy-preserving analytics

Provide aggregate usage data for product and roadmap decisions without user identification.

Interview questions

QWhat is the anonymous identifier?

The anonymous identifier is a non-reversible hash derived from the project’s package.json name and optionally its baseURL. It allows Better Auth to de-duplicate events per project without knowing the user.

Follow-up: Why use a hash instead of sending the project name? A hash avoids directly exposing the project identifier while preserving stable grouping for telemetry.

QWhat purpose does the identifier serve?

It is used for aggregate telemetry grouping, specifically to de-duplicate events from the same project. The documentation describes the collected data as anonymous and intended only for aggregate insights.

Follow-up: What should telemetry avoid collecting? It should exclude credentials, tokens, database URLs, and other sensitive authentication data.

QWhen is the identifier collected?

Telemetry is optional and disabled by default, so an application must enable collection before this identifier is reported. Better Auth also sends a reduced, redacted configuration snapshot rather than the full authentication configuration.

Follow-up: Why is a redacted snapshot preferable? It provides useful configuration context while limiting exposure of sensitive or unnecessary values.

  • getTelemetryAuthConfig
  • telemetry
  • baseURL
  • package.json

Source: Telemetry | Better Auth. Checked 2026-10-15.