{"id":29671413,"url":"https://github.com/tinybirdco/clerk-tinybird","last_synced_at":"2026-02-16T08:32:06.669Z","repository":{"id":283719995,"uuid":"952676431","full_name":"tinybirdco/clerk-tinybird","owner":"tinybirdco","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-12T09:31:30.000Z","size":775,"stargazers_count":2,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-01T04:00:58.168Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://clerk-tinybird.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tinybirdco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-21T17:23:49.000Z","updated_at":"2025-12-12T09:31:34.000Z","dependencies_parsed_at":"2025-03-21T19:40:13.895Z","dependency_job_id":"2b5c573f-56b0-413f-b5c8-0e9c437361d7","html_url":"https://github.com/tinybirdco/clerk-tinybird","commit_stats":null,"previous_names":["tinybirdco/clerk-tinybird"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tinybirdco/clerk-tinybird","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fclerk-tinybird","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fclerk-tinybird/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fclerk-tinybird/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fclerk-tinybird/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinybirdco","download_url":"https://codeload.github.com/tinybirdco/clerk-tinybird/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fclerk-tinybird/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29503809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T08:14:25.707Z","status":"ssl_error","status_checked_at":"2026-02-16T08:14:25.334Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-22T20:07:47.592Z","updated_at":"2026-02-16T08:32:06.654Z","avatar_url":"https://github.com/tinybirdco.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clerk + Tinybird JWT template\n\nThis is a template for a Next.js app that uses [Clerk](https://clerk.com/) for authentication and multi-tenant [Tinybird](https://tinybird.co/) real-time analytics applications.\n\n## Getting Started\n\n1. Create a new Clerk application\n2. Create a new Tinybird workspace\n3. Create an `.env` file from the `.env.example` file and fill in the values\n4. Run `npm install`\n5. Run `npm run dev`\n\nIn Clerk (Dashboard \u003e Configure \u003e JWT templates) choose the `Tinybird` JWT template:\n\n![](./public/clerk-jwt-tinybird.png)\n\nModify the claims to your needs:\n\n```\n{\n\t\"name\": \"frontend_jwt\",\n\t\"limits\": {\n\t\t\"rps\": 10\n\t},\n\t\"scopes\": [\n\t\t{\n\t\t\t\"type\": \"PIPES:READ\",\n\t\t\t\"resource\": \"\u003cYOUR-TINYBIRD-PIPE-NAME\u003e\",\n\t\t\t\"fixed_params\": {\n\t\t\t\t\"org\": \"{{org.slug}}\",\n\t\t\t\t\"user\": \"{{user.id}}\"\n\t\t\t}\n\t\t}\n\t],\n\t\"workspace_id\": \"\u003cYOUR-TINYBIRD-WORKSPACE-ID\u003e\"\n}\n```\n- Use your Tinybird admin token as signking key.\n- Add as many scopes as needed, use fixed params to filter your Tinybird API endpoints.\n- Configure `fixed_params` to match the parameter names and values in your Tinybird API endpoints.\n\nExample:\n\n```sql\nNODE endpoint\nSQL \u003e\n    SELECT * FROM ds\n    WHERE 1\n    {% if defined(org) %}\n        AND org = {{String(org)}}\n    {% end %}\n    {% if defined(user) %}\n        AND user = {{String(user)}}\n    {% end %}\n\nTYPE endpoint\n```\n\nOn your application request a token to `Clerk` using the `tinybird` template, where `tinybird` is the name you gave to the template.\n\n```typescript\n  const authentication = await auth()\n  const { userId, sessionId, getToken } = authentication\n  const token = await getToken({ template: \"tinybird\" })\n\n  fetch('https://api.tinybird.co/v0/pipes/your_pipe.json', {\n  headers: {\n    Authorization: `Bearer ${token}`\n  }\n})\n```\n\n## How it works\n\nOn Sign In, the app authenticates with Clerk, the middleware picks up the session and creates a multi-tenant Tinybird JWT token using the `tinybird` JWT template from Clerk, finally adds the token to the response headers to be used by the application.\n\nUse the token to query Tinybird as the authenticated user.\n\n## User management\n\n- Use Clerk to manage users and organizations.\n- Assign organizations to users and define organization permissions.\n- Use those organization permissions to create multi-tenant Tinybird JWT tokens using the `fixed_params` feature.\n\n## Contributing\n\nPlease open an issue or submit a pull request.\n\n## Support\n\nJoin the Tinybird Slack community to get help with your project.\n\nLearn more about [Tinybird JWT tokens](https://www.tinybird.co/docs/forward/get-started/authentication) and [Clerk](https://www.tinybird.co/docs/forward/publish-your-data/api-endpoints/guides/multitenant-real-time-apis-with-clerk-and-tinybird).\n\n## License\n\nMIT License\n\nCopyright (c) 2025 Tinybird.co\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinybirdco%2Fclerk-tinybird","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinybirdco%2Fclerk-tinybird","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinybirdco%2Fclerk-tinybird/lists"}