name = "traks-collect-dev" main = "src/index.ts" compatibility_date = "2026-06-01" compatibility_flags = ["nodejs_compat"] # --- Dev (local-first: wrangler dev, shared state in /.wrangler-state) --- [[d1_databases]] binding = "DB" database_name = "traks-db-dev" database_id = "cd0ff4bb-5cc4-4002-a259-be02b3234e29" migrations_dir = "../api/src/db/migrations" # Per-site-key flood guard (counted per colo). Pure abuse backstop - # there are no product quotas. 100/s per colo per site key. [[ratelimits]] name = "RATE_LIMIT" namespace_id = "1001" simple = { limit = 6000, period = 60 } # Ingest failure counters (live-DO write failures, pipeline send failures), # queryable via the Analytics Engine SQL API to spot sites outgrowing their # per-site Durable Object before it becomes an outage. [[analytics_engine_datasets]] binding = "METRICS" dataset = "traks_collect_metrics_dev" # Hot-path live stats: one SQLite-backed Durable Object per site, written at # ingest, read by the api worker for "today"/realtime dashboards. [[migrations]] tag = "v1" new_sqlite_classes = ["SiteLiveStore"] [[durable_objects.bindings]] name = "LIVE" class_name = "SiteLiveStore" # Pipelines *stream* binding - events are sent to the stream, the pipeline # moves them into the Iceberg sink. (`stream` replaced the deprecated # `pipeline` key in June 2026.) [[pipelines]] binding = "EVENTS" stream = "f0ee6ab42aa7462094f374857e996b47" # traks_events_dev_stream (dev) [vars] ENVIRONMENT = "development" # The platform ships to customers as a release bundle; the ONLY install path # is the traks.dev deploy wizard. There is no wrangler prod deploy - our own # instance (and any staging one) is installed through the wizard like any # other customer. Dev config above is for local iteration only.