Skip to content

descope-dev/descope-cf-worker

Repository files navigation

cloudflare worker github repo banner

Cloudflare Worker Sample App

Although typically one custom domain is set per Descope Project, if you want to use multiple custom domains with multiple different apps, you can use Cloudflare Workers to do this for you. You can also use a cloudflare worker to help you configure custom domains for each B2B tenant, all using one singular project.

This sample app is built to be deployed as a Cloudflare Worker, utilizing Cloudflare's edge computing capabilities to run serverless code. It is important to ensure that you have configured your Cloudflare account and domain correctly before proceeding with the installation and deployment of this worker.

If you want to learn more about Cloudflare Workers and how this sample app works behind the scenes, you can read our published blog about Descope and Cloudflare Workers.

Table of Contents 📝

  1. Preparation
  2. Configuration
  3. Deployment
  4. Contributing
  5. Issue Reporting
  6. License

Preparation 🛠️

Before you configure your Cloudflare Worker, you need to:

  1. Sign up for a Cloudflare account and configure your domain.
  2. Install the wrangler CLI tool:
npm install -g @cloudflare/wrangler
  1. Authenticate wrangler with your Cloudflare account:
wrangler login

Configuration 🔧

To set up your Cloudflare Worker, follow these steps:

  1. Clone the repository to your local machine.
  2. Install the project dependencies:
yarn install
  1. Make sure that your Cloudflare account ID is correctly entered into the wrangler.toml file.
  2. The script should already contain the necessary environment variables, such as BASE_URL. Verify that these are correct.

Deployment 🚀

Deploy your Worker to Cloudflare by running:

wrangler publish

Contributing 🤝

If you'd like to contribute to the development of this Cloudflare Worker, please follow the standard fork-and-pull-request workflow. Don't forget to update tests as appropriate.

Issue Reporting ⚠️

For any issues or suggestions, feel free to open an issue in the GitHub repository.

License 📜

This project is licensed under the MIT License - see the LICENSE file for details.


Please note that you will need to replace the placeholders like repository URL and any specific details about the worker functionality as needed. Also, ensure that the actual LICENSE file exists in your repository if you are going to reference it.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published