Skip to content

Add rate limiting for GA4 endpoints #237

@simonsmallchua

Description

@simonsmallchua

Summary\nIntroduce rate limiting for GA4 integration endpoints to prevent API quota exhaustion and runaway refresh requests.\n\n## Scope\n- Define rate limits per organisation/user for GA4 endpoints (e.g. account refresh, property fetch, GA4 data fetch).\n- Decide policy: burst vs sustained, per-endpoint vs shared bucket.\n- Add middleware or handler-level guard to enforce limits.\n- Log rate-limit events with request_id/organisation_id; return 429 with retry guidance.\n\n## Acceptance criteria\n- Requests exceeding the configured limit return HTTP 429 with a clear message.\n- Limits can be tuned via config/env.\n- GA4 endpoints remain unaffected under normal usage.\n\n## Notes\n- Consider a shared limiter for all GA4 endpoints to avoid per-endpoint misconfiguration.\n- Prefer Supabase-compatible approaches if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions