{"id":18696175,"url":"https://github.com/apitoolkit/apitoolkit-express","last_synced_at":"2025-04-12T07:30:52.006Z","repository":{"id":59144952,"uuid":"528850547","full_name":"apitoolkit/apitoolkit-express","owner":"apitoolkit","description":"APItoolkit's Express client SDK.","archived":false,"fork":false,"pushed_at":"2025-01-20T12:39:48.000Z","size":1550,"stargazers_count":6,"open_issues_count":7,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T08:24:53.495Z","etag":null,"topics":["apitoolkit","apitoolkit-sdk","expressjs","javascript","nestjs","nodejs","typescript"],"latest_commit_sha":null,"homepage":"https://apitoolkit.io/docs/sdks/nodejs/expressjs","language":"JavaScript","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/apitoolkit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2022-08-25T12:54:38.000Z","updated_at":"2024-10-31T13:56:24.000Z","dependencies_parsed_at":"2024-01-28T19:25:46.011Z","dependency_job_id":"5a7cf641-1995-4937-baf0-561b7455b3c1","html_url":"https://github.com/apitoolkit/apitoolkit-express","commit_stats":null,"previous_names":["apitoolkit/apitoolkit-js"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apitoolkit%2Fapitoolkit-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apitoolkit%2Fapitoolkit-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apitoolkit%2Fapitoolkit-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apitoolkit%2Fapitoolkit-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apitoolkit","download_url":"https://codeload.github.com/apitoolkit/apitoolkit-express/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248533559,"owners_count":21120116,"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":["apitoolkit","apitoolkit-sdk","expressjs","javascript","nestjs","nodejs","typescript"],"created_at":"2024-11-07T11:17:26.693Z","updated_at":"2025-04-12T07:30:51.662Z","avatar_url":"https://github.com/apitoolkit.png","language":"JavaScript","readme":"\u003cp\u003e\n\u003cimg src=\"https://apitoolkit.io/assets/img/logo-full.svg\" alt=\"APIToolkit\" width=\"250px\" /\u003e\n\u003c/p\u003e\n\nAPIToolkit Express Middleware is a middleware that can be used to monitor HTTP requests. It is provides additional functionalities on top of the open telemetry instrumentation which creates a custom span for each request capturing details about the request including request and response bodies.\n\n### Installation\n\nRun the following command to install the express js package from your projects root:\n\n```sh\nnpm install apitoolkit-express\n\n```\n\n### Project setup\n\nIntialize apitoolkit into your project like so:\n\n```js\nimport express from 'express';\nimport { APIToolkit } from 'apitoolkit-express';\n\nconst app = express();\napp.use(express.json());\napp.use(express.urlencoded({ extended: true }));\napp.use(\n  APIToolkit.middleware({\n    serviceName: 'my-service',\n    redactHeaders: ['authorization', 'cookie'],\n    redactResponseBody: ['$.creditCardNumber'], // jsonpath to redact credit card number from response body\n    redactRequestBody: ['$.password'], // jsonpath to redact password from request body\n    captureRequestBody: true, // capture request body and send it to your apitoolkit dashboard\n    captureResponseBody: true // capture response body and send it to your apitoolkit dashboard\n  })\n);\n\napp.get('/hello/:name', (req, res) =\u003e {\n  res.json({ message: `Hello ${req.params.name}!` });\n});\n\n// comes after all other route handlers\napp.use(APIToolkit.errorMiddleware());\n\napp.listen(3000, () =\u003e {\n  console.log('Server started on port 3000');\n});\n```\n\n#### Quick overview of the configuration parameters\n\nAn object with the following optional fields can be passed to the middleware to configure it:\n\n| Option                | Description                                                                                       |\n| --------------------- | ------------------------------------------------------------------------------------------------- |\n| `debug`               | Set to `true` to enable debug mode.                                                               |\n| `serviceName`         | A defined string name of your application.                                                        |\n| `tags`                | A list of defined tags for your services (used for grouping and filtering data on the dashboard). |\n| `serviceVersion`      | A defined string version of your application (used for further debugging on the dashboard).       |\n| `redactHeaders`       | A list of HTTP header keys to redact.                                                             |\n| `redactResponseBody`  | A list of JSONPaths from the response body to redact.                                             |\n| `redactRequestBody`   | A list of JSONPaths from the request body to redact.                                              |\n| `captureRequestBody`  | Default `false`, set to `true` if you want to capture the request body.                           |\n| `captureResponseBody` | Default `false`, set to `true` if you want to capture the response body.                          |\n\n\u003cbr /\u003e\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e To learn more configuration options (redacting fields, error reporting, outgoing requests, etc.) and complete integration guide, please read this [SDK documentation](https://apitoolkit.io/docs/sdks/nodejs/expressjs/utm_campaign=devrel\u0026utm_medium=github\u0026utm_source=sdks_readme).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapitoolkit%2Fapitoolkit-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapitoolkit%2Fapitoolkit-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapitoolkit%2Fapitoolkit-express/lists"}