{"id":21487520,"url":"https://github.com/dtinth/firetoy","last_synced_at":"2026-05-19T00:35:37.262Z","repository":{"id":38772086,"uuid":"273859398","full_name":"dtinth/firetoy","owner":"dtinth","description":"Provision a public-but-secret ephemeral Firebase Realtime Database endpoint.","archived":false,"fork":false,"pushed_at":"2022-12-22T17:00:04.000Z","size":169,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T19:48:55.151Z","etag":null,"topics":["firebase","jwt","typescript"],"latest_commit_sha":null,"homepage":"","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/dtinth.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}},"created_at":"2020-06-21T07:52:30.000Z","updated_at":"2021-09-16T07:41:43.000Z","dependencies_parsed_at":"2022-09-17T12:41:30.106Z","dependency_job_id":null,"html_url":"https://github.com/dtinth/firetoy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtinth%2Ffiretoy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtinth%2Ffiretoy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtinth%2Ffiretoy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtinth%2Ffiretoy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dtinth","download_url":"https://codeload.github.com/dtinth/firetoy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244014113,"owners_count":20383716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["firebase","jwt","typescript"],"created_at":"2024-11-23T13:29:24.163Z","updated_at":"2026-05-19T00:35:32.237Z","avatar_url":"https://github.com/dtinth.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# firetoy\n\nProvision a public-but-secret ephemeral Firebase Realtime Database endpoint.\n\n## Usage\n\nAfter deploying, go to real-time database console and set up the following\nstructure:\n\n- `clients`\n  - `\u003cclientId\u003e`\n    - `jwtSecret`: `\"\u003csecret\u003e\"`\n\nThis sets up the credentials needed to provision endpoints.\n\nNext, mint a JWT with the `\u003cclientId\u003e` in the issuer (`iss`) claim.\n\n```\n$ node\n\u003e require('jsonwebtoken').sign({iss:'\u003cclientId\u003e'},'\u003csecret\u003e')\n'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI8Y2xpZW50SWQ-IiwiaWF0IjoxNTkyNzI1NDA4fQ.9OSAH69VurEp8AZymkxSRPx6hDE8fr1oruVbhjAs4g4'\n```\n\nFinally, call the `provision` function to generate an endpoint.\n\n```\n$ http post https://us-central1-\u003cprojectId\u003e.cloudfunctions.net/provision \\\n  'Authorization: Bearer \u003cjwt\u003e'\n{\n    \"expiresAt\": \"2020-09-18T21:18:33.063Z\",\n    \"tenantId\": \"20200620T211833062Z-dtinth-84856058-2688-490c-9447-f9680897e5fd\"\n}\n```\n\nNow you can use that endpoint:\n\n```\n$ http get https://\u003cprojectId\u003e.firebaseio.com/data/\u003ctenantId\u003e.json\nnull\n\n$ http patch https://\u003cprojectId\u003e.firebaseio.com/data/\u003ctenantId\u003e.json hello=world\n{\n    \"hello\": \"world\"\n}\n\n$ http get https://\u003cprojectId\u003e.firebaseio.com/data/\u003ctenantId\u003e.json\n{\n    \"hello\": \"world\"\n}\n```\n\nThe endpoint expires after 3 months. After the endpoint expires it can still be\nused but it may be deleted (when the deletion logic is implemented).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtinth%2Ffiretoy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdtinth%2Ffiretoy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtinth%2Ffiretoy/lists"}