{"id":13406009,"url":"https://github.com/mswjs/msw","last_synced_at":"2026-04-08T13:01:02.314Z","repository":{"id":37165234,"uuid":"157397583","full_name":"mswjs/msw","owner":"mswjs","description":"Industry standard API mocking for JavaScript.","archived":false,"fork":false,"pushed_at":"2026-04-02T17:07:45.000Z","size":13817,"stargazers_count":17784,"open_issues_count":43,"forks_count":604,"subscribers_count":58,"default_branch":"main","last_synced_at":"2026-04-03T05:11:40.696Z","etag":null,"topics":["api","api-mocking","devtools","mock","mock-service-worker","mocking","mocking-framework","mocking-library","msw","mswjs","service-worker"],"latest_commit_sha":null,"homepage":"https://mswjs.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mswjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"mswjs","open_collective":"mswjs"}},"created_at":"2018-11-13T14:58:44.000Z","updated_at":"2026-04-02T21:08:59.000Z","dependencies_parsed_at":"2025-12-18T00:04:37.790Z","dependency_job_id":null,"html_url":"https://github.com/mswjs/msw","commit_stats":{"total_commits":1559,"total_committers":159,"mean_commits":9.80503144654088,"dds":"0.23669018601667735","last_synced_commit":"9dc2d71199021c62ad8926555c0313d3b1bd6995"},"previous_names":[],"tags_count":297,"template":false,"template_full_name":null,"purl":"pkg:github/mswjs/msw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mswjs%2Fmsw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mswjs%2Fmsw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mswjs%2Fmsw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mswjs%2Fmsw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mswjs","download_url":"https://codeload.github.com/mswjs/msw/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mswjs%2Fmsw/sbom","scorecard":{"id":666303,"data":{"date":"2025-08-11","repo":{"name":"github.com/mswjs/msw","commit":"dafc616505fa0bb7ceb1248a8fb39276a184b723"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 2/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 20 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/release.yml:12","Warn: no topLevel permission defined: .github/workflows/auto.yml:1","Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/compat.yml:1","Warn: no topLevel permission defined: .github/workflows/release-preview.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/smoke-test.yml:1","Warn: no topLevel permission defined: .github/workflows/typescript-nightly.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Info: Possibly incomplete results: error parsing shell code: invalid parameter name: .github/workflows/typescript-nightly.yml:62","Warn: third-party GitHubAction not pinned by hash: .github/workflows/auto.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/auto.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:256: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:259: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:264: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:270: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:73: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:86: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:89: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:94: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:100: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:122: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:125: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:130: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:136: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:155: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:158: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:163: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:169: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:188: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:191: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:196: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:213: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:216: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:221: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:227: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:245: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/compat.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/compat.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/compat.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/compat.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/compat.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/compat.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/compat.yml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/compat.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/compat.yml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/compat.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/compat.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/compat.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lock-closed-issues.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/lock-closed-issues.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-preview.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/release-preview.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-preview.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/release-preview.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-preview.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/release-preview.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/smoke-test.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/smoke-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/smoke-test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/smoke-test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/smoke-test.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/smoke-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/typescript-nightly.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/typescript-nightly.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/typescript-nightly.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/typescript-nightly.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/typescript-nightly.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/typescript-nightly.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/typescript-nightly.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/mswjs/msw/typescript-nightly.yml/main?enable=pin","Info:   0 out of  37 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  16 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"31 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-28mc-g557-92m7","Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-593f-38f6-jp5m","Warn: Project is vulnerable to: GHSA-x2rg-q646-7m2v","Warn: Project is vulnerable to: GHSA-jgmv-j7ww-jx2x","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-c76h-2ccp-4975","Warn: Project is vulnerable to: GHSA-cxrh-j4jr-qwg3","Warn: Project is vulnerable to: GHSA-64vr-g452-qvp3","Warn: Project is vulnerable to: GHSA-9cwx-2883-4wfx","Warn: Project is vulnerable to: GHSA-vg6x-rcgg-rjx6","Warn: Project is vulnerable to: GHSA-x574-m823-4x7w","Warn: Project is vulnerable to: GHSA-4r4m-qw57-chr8","Warn: Project is vulnerable to: GHSA-xcj6-pq6g-qj4x","Warn: Project is vulnerable to: GHSA-356w-63v5-8wf4","Warn: Project is vulnerable to: GHSA-859w-5945-r5v3","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T18:08:58.814Z","repository_id":37165234,"created_at":"2025-08-21T18:08:58.814Z","updated_at":"2025-08-21T18:08:58.814Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31392775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","api-mocking","devtools","mock","mock-service-worker","mocking","mocking-framework","mocking-library","msw","mswjs","service-worker"],"created_at":"2024-07-30T19:02:18.495Z","updated_at":"2026-04-08T13:01:02.268Z","avatar_url":"https://github.com/mswjs.png","language":"TypeScript","readme":"\u003cbr /\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"media/msw-logo.svg\" width=\"100\" alt=\"The Mock Service Worker logo\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eMock Service Worker\u003c/h1\u003e\n\u003cp align=\"center\"\u003eIndustry standard API mocking for JavaScript.\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://kettanaito.com/discord\" target=\"_blank\"\u003eJoin our Discord server\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n## Features\n\n- **Seamless**. A dedicated layer of requests interception at your disposal. Keep your application's code and tests unaware of whether something is mocked or not.\n- **Deviation-free**. Request the same production resources and test the actual behavior of your app. Augment an existing API, or design it as you go when there is none.\n- **Familiar \u0026 Powerful**. Use [Express](https://github.com/expressjs/express)-like routing syntax to intercept requests. Use parameters, wildcards, and regular expressions to match requests, and respond with necessary status codes, headers, cookies, delays, or completely custom resolvers.\n\n---\n\n\u003e \"_I found MSW and was thrilled that not only could I still see the mocked responses in my DevTools, but that the mocks didn't have to be written in a Service Worker and could instead live alongside the rest of my app. This made it silly easy to adopt. The fact that I can use it for testing as well makes MSW a huge productivity booster._\"\n\u003e\n\u003e — [Kent C. Dodds](https://twitter.com/kentcdodds)\n\n## Documentation\n\nThis README will give you a brief overview of the library, but there's no better place to start with Mock Service Worker than its official documentation.\n\n- [Documentation](https://mswjs.io/docs)\n- [**Quick start**](https://mswjs.io/docs/quick-start)\n- [FAQ](https://mswjs.io/docs/faq)\n\n## Examples\n\n- See the list of [**Usage examples**](https://github.com/mswjs/examples)\n\n## Courses\n\nWe've partnered with Egghead to bring you quality paid materials to learn the best practices of API mocking on the web. Please give them a shot! The royalties earned from them help sustain the project's development. Thank you.\n\n- 🚀 [**Mocking REST and GraphQL APIs with Mock Service Worker**](https://egghead.io/courses/mock-rest-and-graphql-apis-with-mock-service-worker-8d471ece?af=8mci9b)\n- 🔌 [Mocking (and testing) WebSocket APIs with Mock Service Worker](https://egghead.io/courses/mocking-websocket-apis-with-mock-service-worker-9933b7f5)\n\n## Browser\n\n- [Learn more about using MSW in a browser](https://mswjs.io/docs/integrations/browser)\n- [`setupWorker` API](https://mswjs.io/docs/api/setup-worker)\n\n### How does it work?\n\nIn-browser usage is what sets Mock Service Worker apart from other tools. Utilizing the [Service Worker API](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API), which can intercept requests for the purpose of caching, Mock Service Worker responds to intercepted requests with your mock definition on the network level. This way your application knows nothing about the mocking.\n\n**Take a look at this quick presentation on how Mock Service Worker functions in a browser:**\n\n[![What is Mock Service Worker?](https://raw.githubusercontent.com/mswjs/msw/main/media/msw-video-thumbnail.jpg)](https://youtu.be/HcQCqboatZk)\n\n### How is it different?\n\n- This library intercepts requests on the network level, which means _after_ they have been performed and \"left\" your application. As a result, the entirety of your code runs, giving you more confidence when mocking;\n- Imagine your application as a box. Every API mocking library out there opens your box and removes the part that does the request, placing a blackbox in its stead. Mock Service Worker leaves your box intact, 1-1 as it is in production. Instead, MSW lives in a separate box next to yours;\n- No more stubbing of `fetch`, `axios`, `react-query`, you-name-it;\n- You can reuse the same mock definition for the unit, integration, and E2E testing. Did we mention local development and debugging? Yep. All running against the same network description without the need for adapters or bloated configurations.\n\n### Usage example\n\n```js\n// 1. Import the library.\nimport { http, HttpResponse } from 'msw'\nimport { setupWorker } from 'msw/browser'\n\n// 2. Describe network behavior with request handlers.\nconst worker = setupWorker(\n  http.get('https://github.com/octocat', ({ request, params, cookies }) =\u003e {\n    return HttpResponse.json(\n      {\n        message: 'Mocked response',\n      },\n      {\n        status: 202,\n        statusText: 'Mocked status',\n      },\n    )\n  }),\n)\n\n// 3. Start mocking by starting the Service Worker.\nawait worker.start()\n```\n\nPerforming a `GET https://github.com/octocat` request in your application will result into a mocked response that you can inspect in your browser's \"Network\" tab:\n\n![Chrome DevTools Network screenshot with the request mocked](https://github.com/mswjs/msw/blob/main/media/msw-quick-look-network.png?raw=true)\n\n\u003e **Tip:** Did you know that although Service Worker runs in a separate thread, your request handlers execute entirely on the client? This way you can use the same languages, like TypeScript, third-party libraries, and internal logic to create the mocks you need.\n\n## Node.js\n\n- [Learn more about using MSW in Node.js](https://mswjs.io/docs/integrations/node)\n- [`setupServer` API](https://mswjs.io/docs/api/setup-server)\n\n### How does it work?\n\nThere's no such thing as Service Workers in Node.js. Instead, MSW implements a [low-level interception algorithm](https://github.com/mswjs/interceptors) that can utilize the very same request handlers you have for the browser. This blends the boundary between environments, allowing you to focus on your network behaviors.\n\n### How is it different?\n\n- Does not stub `fetch`, `axios`, etc. As a result, your tests know _nothing_ about mocking;\n- You can reuse the same request handlers for local development and debugging, as well as for testing. Truly a single source of truth for your network behavior across all environments and all tools.\n\n### Usage example\n\nHere's an example of using Mock Service Worker while developing your Express server:\n\n```js\nimport express from 'express'\nimport { http, HttpResponse } from 'msw'\nimport { setupServer } from 'msw/node'\n\nconst app = express()\nconst server = setupServer()\n\napp.get(\n  '/checkout/session',\n  server.boundary((req, res) =\u003e {\n    // Describe the network for this Express route.\n    server.use(\n      http.get(\n        'https://api.stripe.com/v1/checkout/sessions/:id',\n        ({ params }) =\u003e {\n          return HttpResponse.json({\n            id: params.id,\n            mode: 'payment',\n            status: 'open',\n          })\n        },\n      ),\n    )\n\n    // Continue with processing the checkout session.\n    handleSession(req, res)\n  }),\n)\n```\n\n\u003e This example showcases [`server.boundary()`](https://mswjs.io/docs/api/setup-server/boundary) to scope request interception to a particular closure, which is extremely handy!\n\n## Sponsors\n\nMock Service Worker is trusted by hundreds of thousands of engineers around the globe. It's used by companies like Google, Microsoft, Spotify, Amazon, Netflix, and countless others. Despite that, it remains a hobby project maintained in a spare time and has no opportunity to financially support even a single full-time contributor.\n\n**You can change that!** Consider [sponsoring the effort](https://github.com/sponsors/mswjs) behind one of the most innovative approaches around API mocking. Raise a topic of open source sponsorships with your boss and colleagues. Let's build sustainable open source together!\n\n### Golden sponsors\n\n\u003e Become our _golden sponsor_ and get featured right here, enjoying other perks like issue prioritization and a personal consulting session with us.\n\u003e\n\u003e **Learn more on our [GitHub Sponsors profile](https://github.com/sponsors/mswjs)**.\n\n\u003cbr /\u003e\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://www.github.com/\" target=\"_blank\"\u003e\n        \u003cpicture\u003e\n          \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"media/sponsors/github-light.svg\" /\u003e\n          \u003cimg src=\"media/sponsors/github.svg\" alt=\"GitHub\" height=\"64\" /\u003e\n        \u003c/picture\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://www.codacy.com/\" target=\"_blank\"\u003e\n        \u003cimg src=\"media/sponsors/codacy.svg\" alt=\"Codacy\" height=\"64\" /\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://workleap.com/\" target=\"_blank\"\u003e\n        \u003cimg src=\"media/sponsors/workleap.svg\" alt=\"Workleap\" height=\"64\" width=\"174\" /\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://www.chromatic.com/?ref=mswjs\" target=\"_blank\"\u003e\n        \u003cimg src=\"media/sponsors/chromatic.svg\" alt=\"Chromatic\" height=\"64\" /\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003ca href=\"https://stackblitz.com/\" target=\"_blank\"\u003e\n        \u003cimg src=\"media/sponsors/stackblitz.svg\" alt=\"StackBlitz\" height=\"64\" /\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Silver sponsors\n\n\u003e Become our _silver sponsor_ and get your profile image and link featured right here.\n\u003e\n\u003e **Learn more on our [GitHub Sponsors profile](https://github.com/sponsors/mswjs)**.\n\n\u003cbr /\u003e\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://www.replay.io/\" target=\"_blank\"\u003e\n        \u003cimg src=\"media/sponsors/replay.svg\" alt=\"Replay\" height=\"64\" /\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://codemod.com/\" target=\"_blank\"\u003e\n        \u003cimg src=\"media/sponsors/codemod.svg\" alt=\"Codemod\" height=\"64\" width=\"128\" /\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://github.com/ryanmagoon\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://github.com/ryanmagoon.png\" alt=\"Ryan Magoon\" height=\"64\" /\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Bronze sponsors\n\n\u003e Become our _bronze sponsor_ and get your profile image and link featured in this section.\n\u003e\n\u003e **Learn more on our [GitHub Sponsors profile](https://github.com/sponsors/mswjs)**.\n\n\u003cbr /\u003e\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://materialize.com/\" target=\"_blank\"\u003e\n        \u003cimg src=\"media/sponsors/materialize.svg\" alt=\"Materialize\" height=\"64\" /\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://trigger.dev/\" target=\"_blank\"\u003e\n        \u003cimg src=\"media/sponsors/trigger-dev.png\" alt=\"Trigger.dev\" height=\"64\" /\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://vital.io/\" target=\"_blank\"\u003e\n        \u003cimg src=\"media/sponsors/vital.svg\" alt=\"Vital\" width=\"64\" /\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Awards \u0026 mentions\n\nWe've been extremely humbled to receive awards and mentions from the community for all the innovation and reach Mock Service Worker brings to the JavaScript ecosystem.\n\n\u003ctable\u003e\n  \u003ctr valign=\"middle\"\u003e\n    \u003ctd width=\"124\"\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/mswjs/msw/main/media/tech-radar.png\" width=\"124\" alt=\"Technology Radar\"\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ch4\u003eSolution Worth Pursuing\u003c/h4\u003e\n      \u003cp\u003e\u003cem\u003e\u003ca href=\"https://www.thoughtworks.com/radar/languages-and-frameworks/mock-service-worker\"\u003eTechnology Radar\u003c/a\u003e (2020–2021)\u003c/em\u003e\u003c/p\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"124\"\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/mswjs/msw/main/media/os-awards.png\" width=\"124\" alt=\"Open Source Awards 2020\"\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ch4\u003eThe Most Exciting Use of Technology\u003c/h4\u003e\n      \u003cp\u003e\u003cem\u003e\u003ca href=\"https://osawards.com/javascript/2020\"\u003eOpen Source Awards\u003c/a\u003e (2020)\u003c/em\u003e\u003c/p\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n","funding_links":["https://github.com/sponsors/mswjs","https://opencollective.com/mswjs","https://github.com/sponsors/mswjs)*"],"categories":["TypeScript","Repository","api","API","Testing tools","Tools","Uncategorized","For React Native","Packages","Testing","node.js/javascript","\u003e 10K ⭐️"],"sub_categories":["Testing","Framework","Uncategorized","Helpers","Mocking requests","collection"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmswjs%2Fmsw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmswjs%2Fmsw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmswjs%2Fmsw/lists"}