{"id":19294717,"url":"https://github.com/moesif/moesif-cloudflare","last_synced_at":"2025-11-11T20:05:16.131Z","repository":{"id":46050390,"uuid":"166114883","full_name":"Moesif/moesif-cloudflare","owner":"Moesif","description":"Moesif Cloudflare SDK, for API Monitoring, Analytics, and Monetization.","archived":false,"fork":false,"pushed_at":"2025-04-14T17:53:44.000Z","size":180,"stargazers_count":4,"open_issues_count":0,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-14T18:42:12.896Z","etag":null,"topics":["analytics","api-analytics","api-logs","api-management","api-monetization","api-monitoring","cloudflare","cloudflare-workers","javascript","logger","logging","monitoring","nodejs","observabi","service-workers","usage-based-billing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Moesif.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":"2019-01-16T21:28:42.000Z","updated_at":"2025-01-22T00:05:43.000Z","dependencies_parsed_at":"2024-06-22T07:13:30.148Z","dependency_job_id":"7d28f85d-dbf3-49fb-99cb-16ab62e9d214","html_url":"https://github.com/Moesif/moesif-cloudflare","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moesif%2Fmoesif-cloudflare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moesif%2Fmoesif-cloudflare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moesif%2Fmoesif-cloudflare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moesif%2Fmoesif-cloudflare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Moesif","download_url":"https://codeload.github.com/Moesif/moesif-cloudflare/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248941675,"owners_count":21186919,"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":["analytics","api-analytics","api-logs","api-management","api-monetization","api-monitoring","cloudflare","cloudflare-workers","javascript","logger","logging","monitoring","nodejs","observabi","service-workers","usage-based-billing"],"created_at":"2024-11-09T22:39:24.879Z","updated_at":"2025-11-11T20:05:11.104Z","avatar_url":"https://github.com/Moesif.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Moesif Cloudflare SDK Documentation\nby [Moesif](https://moesif.com), the [API analytics](https://www.moesif.com/features/api-analytics) and [API monetization](https://www.moesif.com/solutions/metered-api-billing) platform.\n\n\u003e If you're new to Moesif, see [our Getting Started](https://www.moesif.com/docs/) resources to quickly get up and running.\n\n## Overview\nThis SDK allows you to integrate [Moesif](https://www.moesif.com) with [Cloudflare Workers](https://developers.cloudflare.com/workers/) using the new ECMAScript modules (ES modules).\n\nThis NPM package only supports Node.js version 18 and 20.\n\n## Important Note about Legacy Service Worker Model\nIf you are using Cloudflare's [Service Workers API](https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/) instead of the new ES modules,\nplease follow the [legacy instructions](/legacy/README.md).\n\n## Prerequisites\nBefore using this SDK, make sure you have the following:\n\n- [An active Moesif account](https://moesif.com/wrap)\n- [A Moesif Application ID](#get-your-moesif-application-id)\n\n### Get Your Moesif Application ID\nAfter you log into [Moesif Portal](https://www.moesif.com/wrap), you can get your Moesif Application ID during the onboarding steps. You can always access the Application ID any time by following these steps from Moesif Portal after logging in:\n\n1. Select the account icon to bring up the settings menu.\n2. Select **Installation** or **API Keys**.\n3. Copy your Moesif Application ID from the **Collector Application ID** field.\n\n\u003cimg class=\"lazyload blur-up\" src=\"images/app_id.png\" width=\"700\" alt=\"Accessing the settings menu in Moesif Portal\"\u003e\n\n## Install the SDK\n\nIn the directory of your Worker project created with Wranger, install the SDK:\n\n```bash\nnpm install moesif-cloudflare\n```\n\n## Configure the SDK\nSee the available [configuration options](#configuration-options) to learn how to configure the SDK for your use case.\n\n## How to Use\nUsing the SDK involves three simple steps:\n\n1. Import the `moesifMiddleware` function.\n2. Specify your [Moesif Application ID](#get-your-moesif-application-id) in the Moesif `options` object.\n3. Wrap your handler with `moesifMiddleware`.\n\nFor example:\n\n```javascript\nimport moesifMiddleware from 'moesif-cloudflare';\n\nconst options = {\n  applicationId: 'YOUR MOESIF Application ID',\n};\n\n// your original fetch handler.\nasync function originalFetchHandler(request, _env, context) {\n  // your code.\n}\n\n// this create a new fetch that is wrapped by moesifMiddleware\nconst wrappedFetchHandler = moesifMiddleware(originalFetch, options);\n\n// export the fetch handler.\nexport default {\n  fetch: wrappedFetchHandler\n};\n```\n\n## Troubleshoot\nFor a general troubleshooting guide that can help you solve common problems, see [Server Troubleshooting Guide](https://www.moesif.com/docs/troubleshooting/server-troubleshooting-guide/).\n\nOther troubleshooting supports:\n\n- [FAQ](https://www.moesif.com/docs/faq/)\n- [Moesif support email](mailto:support@moesif.com)\n\n## Repository Structure\n\n```\n.\n├── esm/\n├── example-project/\n├── images/\n├── legacy/\n├── LICENSE\n└── README.md\n```\n\n## Configuration Options\nThe following sections describe the available configuration options for this SDK. You can set these options in the Moesif initialization options object. See [the example Worker project code](https://github.com/Moesif/moesif-cloudflare/blob/717d1202da5996f12c74046e7c7ec75654bd819e/example-project/src/index.js#L40) for an example.\n\nYou can see the full list of options in the [`prepareOptions.mjs`](/esm/src/prepareOptions.mjs) file.\n\n### `identifyUser`\n\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003cth scope=\"col\"\u003e\n    Data type\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Parameters\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Return type\n   \u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\n    Function\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003e(req, res, env, ctx)\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003eString\u003c/code\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### Parameters:\n\n- **`req`**: a [`Request`](https://developers.cloudflare.com/workers/runtime-apis/request/) object.\n- **`res`**: a [`Response`](https://developers.cloudflare.com/workers/runtime-apis/response/) object.\n- **`env`**: an `env` object representing the [bindings](https://developers.cloudflare.com/workers/configuration/environment-variables/) available to the Worker.\n- **`ctx`**: [a `Context` API object](https://developers.cloudflare.com/workers/runtime-apis/context/).\n\nThe function returns a user ID string. This allows Moesif to attribute API requests to individual unique users\nso you can understand who is calling your API. You can use this simultaneously with [`identifyCompany`](#identifycompany)\nto track both individual customers and the companies they are a part of.\n\nSee the [example project's `identifyUser` function](https://github.com/Moesif/moesif-cloudflare/blob/717d1202da5996f12c74046e7c7ec75654bd819e/example-project/src/index.js#L42) for an example.\n\n### `identifyCompany`\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003cth scope=\"col\"\u003e\n    Data type\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Parameters\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Return type\n   \u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\n    Function\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003e(req, res, env, ctx)\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003eString\u003c/code\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### Parameters:\n\n- **`req`**: a [`Request`](https://developers.cloudflare.com/workers/runtime-apis/request/) object.\n- **`res`**: a [`Response`](https://developers.cloudflare.com/workers/runtime-apis/response/) object.\n- **`env`**: an `env` object representing the [bindings](https://developers.cloudflare.com/workers/configuration/environment-variables/) available to the Worker.\n- **`ctx`**: [a `Context` API object](https://developers.cloudflare.com/workers/runtime-apis/context/).\n\nThis function returns a company ID string. If you have a B2B business, this allows Moesif to attribute\nAPI requests to specific companies or organizations so you can understand which accounts are\ncalling your API. You can use this simultaneously with [`identifyUser`](#identifyuser) to track both\nindividual customers and the companies they are a part of.\n\nSee the [example project's `identifyCompany` function](https://github.com/Moesif/moesif-cloudflare/blob/717d1202da5996f12c74046e7c7ec75654bd819e/example-project/src/index.js#L47) for an example.\n\n### `getSessionToken`\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003cth scope=\"col\"\u003e\n    Data type\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Parameters\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Return type\n   \u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\n    Function\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003e(req, res, env, ctx)\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003eString\u003c/code\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### Parameters\n- **`req`**: a [`Request`](https://developers.cloudflare.com/workers/runtime-apis/request/) object.\n- **`res`**: a [`Response`](https://developers.cloudflare.com/workers/runtime-apis/response/) object.\n- **`env`**: an `env` object representing the [bindings](https://developers.cloudflare.com/workers/configuration/environment-variables/) available to the Worker.\n- **`ctx`**: [a `Context` API object](https://developers.cloudflare.com/workers/runtime-apis/context/).\n\nThis function returns a session token such as an API key.\n\nFor example:\n\n```javascript\nvar options = {\n  getSessionToken: function (req, res, env, ctx) {\n    // your code here must return a string. Example Below\n    return req.headers.get['Authorization'];\n  }\n}\n```\n\n### `getApiVersion`\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003cth scope=\"col\"\u003e\n    Data type\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Parameters\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Return type\n   \u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\n    Function\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003e(req, res, env, ctx)\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003eString\u003c/code\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### Parameters\n- **`req`**: a [`Request`](https://developers.cloudflare.com/workers/runtime-apis/request/) object.\n- **`res`**: a [`Response`](https://developers.cloudflare.com/workers/runtime-apis/response/) object.\n- **`env`**: an `env` object representing the [bindings](https://developers.cloudflare.com/workers/configuration/environment-variables/) available to the Worker.\n- **`ctx`**: [a `Context` API object](https://developers.cloudflare.com/workers/runtime-apis/context/).\n\nThis function\nreturns a string to tag requests with a specific version of your API.\n\nFor example:\n\n```javascript\nvar options = {\n  getApiVersion: function (req, res, env, ctx) {\n    // your code here must return a string. Example Below\n    return req.headers.get['X-Api-Version']\n  }\n}\n```\n\n### `maskContent`\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003cth scope=\"col\"\u003e\n    Data type\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Parameters\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Return type\n   \u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\n    Function\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003e(MoesifEventModel)\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003eMoesifEventModel\u003c/code\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nA function that takes the final Moesif event model as an\nargument before sending the event model object to Moesif. \n\nWith `maskContent`, you can make modifications to headers or body such as\nremoving certain header or body fields.\n\n```javascript\nimport _ from 'lodash';\n\nvar options = {\n  maskContent: function(event) {\n    // remove any field that you don't want to be sent to Moesif.\n    const newEvent = _.omit(event, ['request.headers.Authorization', 'event.response.body.sensitive_field'])\n    return newEvent;\n  }\n};\n```\n\nMoesif's event model format looks like this:\n\n```json\n{\n  \"request\": {\n    \"time\": \"2022-08-08T04:45:42.914\",\n    \"uri\": \"https://api.acmeinc.com/items/83738/reviews/\",\n    \"verb\": \"POST\",\n    \"api_version\": \"1.1.0\",\n    \"ip_address\": \"61.48.220.123\",\n    \"headers\": {\n      \"Host\": \"api.acmeinc.com\",\n      \"Accept\": \"*/*\",\n      \"Connection\": \"Keep-Alive\",\n      \"Content-Type\": \"application/json\",\n      \"Content-Length\": \"126\",\n      \"Accept-Encoding\": \"gzip\"\n    },\n    \"body\": {\n      \"items\": [\n        {\n          \"direction_type\": 1,\n          \"item_id\": \"fwdsfrf\",\n          \"liked\": false\n        },\n        {\n          \"direction_type\": 2,\n          \"item_id\": \"d43d3f\",\n          \"liked\": true\n        }\n      ]\n    }\n  },\n  \"response\": {\n    \"time\": \"2022-08-08T04:45:42.924\",\n    \"status\": 500,\n    \"headers\": {\n      \"Vary\": \"Accept-Encoding\",\n      \"Pragma\": \"no-cache\",\n      \"Expires\": \"-1\",\n      \"Content-Type\": \"application/json; charset=utf-8\",\n      \"Cache-Control\": \"no-cache\"\n    },\n    \"body\": {\n      \"Error\": \"InvalidArgumentException\",\n      \"Message\": \"Missing field location\"\n    }\n  },\n  \"user_id\": \"my_user_id\",\n  \"company_id\": \"my_company_id\",\n  \"session_token\":\"end_user_session_token\",\n  \"tags\": \"tag1, tag2\"\n}\n```\n\nFor more information about the different fields of Moesif's event model,\nsee the following table or the [Moesif Node.js API documentation](https://www.moesif.com/docs/api?javascript).\n\nName | Required | Description\n--------- | -------- | -----------\n`request` | Yes | The object that specifies the API request.\n`request.time`| Yes | Timestamp for the request in ISO 8601 format.\n`request.uri`| Yes | Full URI such as `https://api.com/?query=string` including host, query string, and so on.\n`request.verb`| Yes | The HTTP method—for example, `GET` and `POST`.\n`request.api_version`| No | API Version you want to tag this request with such as `1.0.0`.\n`request.ip_address`| No | IP address of the client. If not set, Moesif uses the IP address of your logging API calls.\n`request.headers`| Yes | Headers of the  request as a `Map\u003cstring, string\u003e` object. Multiple headers with the same key name should be combined together such that the values are joined by a comma. For more information, see [HTTP Header Protocol on w3.org](https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2)\n`request.body`| No | Body of the request in JSON format or base64 encoded binary data. To specify the transfer encoding, use `request.transfer_encoding`.\n`request.transfer_encoding`| No | A string that specifies the transfer encoding of the request body sent to Moesif. If not specified, Moesif assumes the request body assumed to be JSON or text. Only supported value is `base64` for sending binary data like protocol buffers.\n||\n`response` | No | The object that specifies the `response message`. If not set, it implies a null response such as a timeout.\n`response.time`| Yes | Timestamp for the response in ISO 8601 format.\n`response.status`| Yes | HTTP response status code number such as `200 OK` or `500 Internal Server Error`.\n`response.ip_address`| No | IP address of the responding server.\n`response.headers`| Yes | Headers of the response as a `Map\u003cstring, string\u003e` object. Multiple headers with the same key name should be combined together such that the values are joined by a comma. For more information, see [HTTP Header Protocol on w3.org](https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2)\n`response.body`| No | Body of the response in JSON format or base64 encoded binary data. To specify the transfer encoding, use `response.transfer_encoding`\n`response.transfer_encoding`| No | A string that specifies the transfer encoding of the request body sent to Moesif. If not specified, Moesif assumes the body to be JSON or text. Only supported value is `base64` for sending binary data like protocol buffers.\n||\n`session_token` | Recommended | The end user session token such as a JWT or API key, which may or may not be temporary. Moesif automatically detects the session token if not set.\n`user_id` | Recommended | Identifies this API call to a permanent user ID.\n`metadata` | No | A JSON Object consisting of any custom metadata to be stored with this event.\n\n### `getMetadata`\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003cth scope=\"col\"\u003e\n    Data type\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Parameters\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Return type\n   \u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\n    Function\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003e(req, res, env, ctx)\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003eObject\u003c/code\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### Parameters\n- **`req`**: a [`Request`](https://developers.cloudflare.com/workers/runtime-apis/request/) object.\n- **`res`**: a [`Response`](https://developers.cloudflare.com/workers/runtime-apis/response/) object.\n- **`env`**: an `env` object representing the [bindings](https://developers.cloudflare.com/workers/configuration/environment-variables/) available to the Worker.\n- **`ctx`**: [a `Context` API object](https://developers.cloudflare.com/workers/runtime-apis/context/).\n\nThis function returns an object containing custom metadata that Moesif can associate with the request. The metadata must be a simple JavaScript object that can be converted to JSON. \n\nFor example, you may want to save a virtual machine instance ID, a trace ID, or a tenant ID with the request.\n\n```javascript\nvar options = {\n  getMetadata: function (req, res, env, ctx) {\n    // your code here:\n    return {\n      foo: 'custom data',\n      bar: 'another custom data'\n    };\n  }\n}\n```\n\n### `skip`\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003cth scope=\"col\"\u003e\n    Data type\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Parameters\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Return type\n   \u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\n    Function\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003e(req, res, env, ctx)\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003eBoolean\u003c/code\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### Parameters\n- **`req`**: a [`Request`](https://developers.cloudflare.com/workers/runtime-apis/request/) object.\n- **`res`**: a [`Response`](https://developers.cloudflare.com/workers/runtime-apis/response/) object.\n- **`env`**: an `env` object representing the [bindings](https://developers.cloudflare.com/workers/configuration/environment-variables/) available to the Worker.\n- **`ctx`**: [a `Context` API object](https://developers.cloudflare.com/workers/runtime-apis/context/).\n\nThis function returns `true`\nif you want to skip the event. Skipping an event means Moesif doesn't log the event.\n\nThe following example skips requests to the root path `/` and the `/health` path:\n\n```javascript\nvar options = {\n  skip: function (req, res, env, ctx) {\n    const url = new URL(req.url)\n    // your code here must return a boolean. Example Below\n    if (url.pathname === '/' || url.pathname === '/health') {\n      // Skip logging traffic to root path or health probe.\n      return true;\n    }\n    return false\n  }\n}\n```\n\n### `logBody`\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003cth scope=\"col\"\u003e\n    Data type\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Default\n   \u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\n    \u003ccode\u003eBoolean\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003etrue\u003c/code\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\nWhether to log request and response body to Moesif.\n\n### `hideCreditCards`\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003cth scope=\"col\"\u003e\n    Data type\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Default\n   \u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\n    \u003ccode\u003eBoolean\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003etrue\u003c/code\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nThis masks any credit cards using the [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm).\n\n### `disableTransactionId`\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003cth scope=\"col\"\u003e\n    Data type\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Default\n   \u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\n    \u003ccode\u003eBoolean\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003efalse\u003c/code\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n`X-Moesif-Transaction-Id` helps identify transactions in Moesif. Set this option to `true` to prevent insertion of `X-Moesif-Transaction-Id` response header.\n\n### `debug`\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003cth scope=\"col\"\u003e\n    Data type\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Default\n   \u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\n    \u003ccode\u003eBoolean\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003efalse\u003c/code\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nSet to `true` to print debug logs. This may help you [troubleshoot](#troubleshoot) if you're having integration issues.\n\n### `fetchTimeoutMS`\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003cth scope=\"col\"\u003e\n    Data type\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Default\n   \u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\n    \u003ccode\u003eNumber\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003e120000\u003c/code\u003e milliseconds\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nThe fetch timeout in milliseconds so that Moesif can log the call even if origin server doesnt respond.\n\n### `requestMaxBodySize`\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003cth scope=\"col\"\u003e\n    Data type\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Default\n   \u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\n    \u003ccode\u003eNumber\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003e100000\u003c/code\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nThe maximum request body size in bytes to log when sending the data to Moesif.\n\n### `responseMaxBodySize`\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003cth scope=\"col\"\u003e\n    Data type\n   \u003c/th\u003e\n   \u003cth scope=\"col\"\u003e\n    Default\n   \u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\n    \u003ccode\u003eNumber\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ccode\u003e100000\u003c/code\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nThe maximum response body size in bytes to log when sending the data to Moesif.\n\n## Example\n\nSee the [`example-project` folder](/example-project/) for an example. The example is generated using C3 (`create-cloudflare-cli`) and follows the [Cloudflare get started guide](https://developers.cloudflare.com/workers/get-started/guide/).\n\n## How to Get Help\nIf you face any issues using this SDK, try the [troubheshooting guidelines](#troubleshoot). For further assistance, reach out to our [support team](mailto:support@moesif.com).\n\n## Explore Other Integrations\n\nExplore other integration options from Moesif:\n\n- [Server integration options documentation](https://www.moesif.com/docs/server-integration/)\n- [Client integration options documentation](https://www.moesif.com/docs/client-integration/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoesif%2Fmoesif-cloudflare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoesif%2Fmoesif-cloudflare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoesif%2Fmoesif-cloudflare/lists"}