{
  "markdown": "# YourTraffic\n\nOpen-source, privacy-first web analytics. Unlimited websites, a first-class REST API and a native MCP server for agents. No cookies, no personal data, no consent banners.\n\n## Self-hosting\n\n### Prerequisites\n\n- [Vercel CLI](https://vercel.com/docs/cli) installed globally\n- A Postgres database\n- Node 20 or newer\n\n### Set up\n\nClone the repo and install dependencies.\n\n```\ngit clone https://github.com/kozmos-tech/yourtraffic\ncd yourtraffic\nnpm install\n```\n\nCopy the example env file and fill it in.\n\n```\ncp .env.example .env\n```\n\n- `DATABASE_URL`. Your Postgres connection string. The app fails to start without it.\n- `BETTER_AUTH_SECRET`. A long random secret. Generate one with `openssl rand -base64 32`. Never ship the default, since visitor hashes are salted from it.\n- `BETTER_AUTH_URL`. The public origin of your deployment, like `https://analytics.example.com`. Use `http://localhost:3000` in development. This is also the origin MCP clients discover for OAuth, so it must be the exact public URL with no trailing path.\n- `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET`. Optional. Set both to enable Google sign-in on the login and signup pages. Create OAuth credentials in the Google Cloud console and add `BETTER_AUTH_URL` + `/api/auth/callback/google` as an authorized redirect URI. Leave them blank to hide the Google button.\n\nCreate the database tables before the first run.\n\n```\nnpm run db:migrate\n```\n\n### Run it\n\n```\nvc dev\nopen http://localhost:3000\n```\n\nSign in, add a website, then drop the shown snippet into the `<head>` of your site. Stats appear within seconds of the first visit.\n\n## Deploy\n\n```\nnpm install\nvc deploy\n```\n\nSet `DATABASE_URL`, `BETTER_AUTH_SECRET` and `BETTER_AUTH_URL` in your Vercel project settings, then run the migration against your production database.\n\n## Database\n\nSchema lives in [src/db/schema.ts](src/db/schema.ts). Generate a migration after changing it, then apply it.\n\n```\nnpm run db:generate\nnpm run db:migrate\n```\n\n## Reading your stats\n\nEvery project has an api key, shown under Settings in the dashboard.\n\n- REST API. Pass the key as a Bearer token to `/api/v1/stats`. See [llms.txt](https://yourtraffic.dev/llms.txt) for the full guide.\n- MCP server. Point an agent at `/mcp`. It uses OAuth, so you sign in to approve access and no api key is needed.\n",
  "bytes": 2322,
  "sha": "fc8954e4a65260151c9e0d6011a558670192c626febaac729a38e27ab9f25221",
  "repo_slug": "kozmos-tech/yourtraffic",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_kozmos_tech_yourtraffic_ffeef739/readme"
}