{"id":20130454,"url":"https://github.com/ravendb/template-cloudflare-worker","last_synced_at":"2026-01-04T07:04:44.353Z","repository":{"id":166239246,"uuid":"599284710","full_name":"ravendb/template-cloudflare-worker","owner":"ravendb","description":"A batteries included template for kick starting a TypeScript Cloudflare worker project that connects with a RavenDB Cloud database backend.","archived":false,"fork":false,"pushed_at":"2024-04-03T18:52:24.000Z","size":1303,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-31T01:43:04.385Z","etag":null,"topics":["cloudflare","cloudflare-workers","ravendb","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ravendb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-02-08T20:33:29.000Z","updated_at":"2023-05-30T07:22:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"0b91238f-153c-4620-8369-157779c918d0","html_url":"https://github.com/ravendb/template-cloudflare-worker","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravendb%2Ftemplate-cloudflare-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravendb%2Ftemplate-cloudflare-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravendb%2Ftemplate-cloudflare-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravendb%2Ftemplate-cloudflare-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ravendb","download_url":"https://codeload.github.com/ravendb/template-cloudflare-worker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244054703,"owners_count":20390620,"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":["cloudflare","cloudflare-workers","ravendb","typescript"],"created_at":"2024-11-13T20:38:43.302Z","updated_at":"2026-01-04T07:04:44.284Z","avatar_url":"https://github.com/ravendb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RavenDB Cloudflare Worker Template (TypeScript)\n\n[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/ravendb/template-cloudflare-worker) [![Open on StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)][stackblitz]\n\nA batteries included template for kick starting a TypeScript Cloudflare worker project that connects to a hosted RavenDB database.\n\n[RavenDB][cloud-signup] is a NoSQL document database for distributed applications offering industry-leading security without compromising performance. With a RavenDB database you can set up a NoSQL data architecture or add a NoSQL layer to your current relational database.\n\n\u003e The easiest way to get started with RavenDB is by creating [a free RavenDB Cloud account][cloud-signup] or requesting a free license to [download it yourself][download].\n\u003e\n\u003e If you are _brand new_ to RavenDB, we recommend starting with the [Getting Started guide][docs-get-started], the [RavenDB bootcamp][learn-bootcamp], or the [Try RavenDB][learn-demo] experience.\n\n## How to Use This Template\n\nTo create a `my-project` directory using this template, run:\n\n```sh\n$ npm init cloudflare my-project https://github.com/ravendb/template-cloudflare-worker\n# or\n$ yarn create cloudflare my-project https://github.com/ravendb/template-cloudflare-worker\n# or\n$ pnpm create cloudflare my-project https://github.com/ravendb/template-cloudflare-worker\n```\n\n\u003e **Note:** Each command invokes [`create-cloudflare`](https://www.npmjs.com/package/create-cloudflare) for project creation.\n\nTo start the worker:\n\n```sh\n$ npm start\n```\n\n### Configure the Template\n\nRead through [the step-by-step guide in the RavenDB docs][docs-howto] that covers how to get up and running successfully with this template by configuring the worker to use mTLS certificates.\n\n### Wrangler Environment Variables\n\nIn `wrangler.toml`:\n\n- `DB_URLS`: Comma-separated values for your RavenDB cluster node URLs\n- `DB_NAME`: Database to connect to. **Warning:** Ensure the database exists otherwise you will receive a `DatabaseNotFoundException`.\n\nThese will automatically be set during deployment and will override any settings in the Cloudflare dashboard.\n\n### Deploying to Cloudflare\n\nYou can manually deploy through the Wrangler CLI using `wrangler deploy` but the template is automatically configured for CI/CD using GitHub Actions workflows. You will need the following secrets:\n\n- `CF_API_TOKEN` -- The API token secret for your deployment. Requires access to workers.\n- `CF_ACCOUNT_ID` -- Your global Cloudflare account ID\n\nThese are set automatically if using the Cloudflare Worker Deployment wizard.\n\n### mTLS Certificates\n\nObtain your RavenDB client certificate from the Cloud dashboard, Manage Server \u003e Certificates in the Studio, or the Raven Admin CLI. You will need the `.crt` (public key) and `.key` (private key) files.\n\nUpload the mTLS certificate using `wrangler`:\n\n```sh\n$ npx wrangler mtls-certificate upload --cert cert.crt --key key.key --name cert_name\n```\n\nThis will output your `\u003cCERTIFICATE_ID\u003e` to use in your `wrangler.toml` file for the `DB_CERT` binding. See the [Cloudflare mTLS for Workers][cf-workers-mtls] documentation for more.\n\n[stackblitz]: https://stackblitz.com/github/ravendb/template-cloudflare-worker\n[cloud-signup]: https://cloud.ravendb.net?utm_source=github\u0026utm_medium=web\u0026utm_campaign=github_template_cloudflare_worker\u0026utm_content=cloud_signup\n[download]: https://ravendb.net/download?utm_source=github\u0026utm_medium=web\u0026utm_campaign=github_template_cloudflare_worker\u0026utm_content=download\n[docs-get-started]: https://ravendb.net/docs/article-page/csharp/start/getting-started?utm_source=github\u0026utm_medium=web\u0026utm_campaign=github_template_cloudflare_worker\u0026utm_content=docs_get_started\n[docs-create-db]: https://ravendb.net/docs/article-page/csharp/studio/database/create-new-database/general-flow?utm_source=github\u0026utm_medium=web\u0026utm_campaign=github_template_cloudflare_worker\u0026utm_content=docs_new_db\n[learn-bootcamp]: https://ravendb.net/learn/bootcamp?utm_source=github\u0026utm_medium=web\u0026utm_campaign=github_template_cloudflare_worker\u0026utm_content=learn_bootcamp\n[learn-demo]: https://demo.ravendb.net/?utm_source=github\u0026utm_medium=web\u0026utm_campaign=github_template_cloudflare_worker\u0026utm_content=learn_demo\n[docs-howto]: https://ravendb.net/docs/article-page/nodejs/getting-started/guides/cloudflare-workers/overview?utm_source=github\u0026utm_medium=web\u0026utm_campaign=github_template_cloudflare_worker\u0026utm_content=docs_howto\n[docs-howto-video]: #tbd\n[cf-workers-mtls]: https://developers.cloudflare.com/workers/runtime-apis/mtls/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fravendb%2Ftemplate-cloudflare-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fravendb%2Ftemplate-cloudflare-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fravendb%2Ftemplate-cloudflare-worker/lists"}