Home / Function/ fetchAllAuthMetrics() — supabase Function Reference

fetchAllAuthMetrics() — supabase Function Reference

Architecture documentation for the fetchAllAuthMetrics() function in OverviewUsage.constants.ts from the supabase codebase.

Entity Profile

Relationship Graph

Source Code

apps/studio/components/interfaces/Auth/Overview/OverviewUsage.constants.ts lines 31–51

export const fetchAllAuthMetrics = async (projectRef: string): Promise<RawAuthMetricsResponse> => {
  const { data, error } = await get(
    `/platform/projects/{ref}/analytics/endpoints/auth.metrics` as any,
    {
      params: {
        path: { ref: projectRef },
        query: {
          interval: '1day',
        },
      },
    }
  )
  if (error) throw error

  const parsed = RawAuthMetricsResponseSchema.safeParse(data)
  if (!parsed.success) {
    const first = parsed.error.issues[0]
    throw new Error(`Invalid auth metrics response: ${first?.message ?? 'Invalid shape'}`)
  }
  return parsed.data
}

Subdomains

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free