{"id":28581421,"url":"https://github.com/filiphric/cypress-plugin-api","last_synced_at":"2025-10-06T04:08:26.914Z","repository":{"id":61001825,"uuid":"547483426","full_name":"filiphric/cypress-plugin-api","owner":"filiphric","description":"Cypress plugin to show your API information in the Cypress UI runner","archived":false,"fork":false,"pushed_at":"2024-07-14T08:30:09.000Z","size":2384,"stargazers_count":272,"open_issues_count":25,"forks_count":36,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-09-12T02:57:05.688Z","etag":null,"topics":["api","cypress","cypress-io","testing"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/filiphric.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":["filiphric"],"custom":["https://filiphric.com/workshops"]}},"created_at":"2022-10-07T19:05:18.000Z","updated_at":"2025-08-20T14:28:49.000Z","dependencies_parsed_at":"2024-06-18T15:25:26.312Z","dependency_job_id":"704cb846-c1e3-4850-a8c0-6cb97f948de3","html_url":"https://github.com/filiphric/cypress-plugin-api","commit_stats":{"total_commits":104,"total_committers":3,"mean_commits":"34.666666666666664","dds":0.06730769230769229,"last_synced_commit":"d639f3eb06d0fcfecafb1d0da181935fc003a239"},"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"purl":"pkg:github/filiphric/cypress-plugin-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filiphric%2Fcypress-plugin-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filiphric%2Fcypress-plugin-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filiphric%2Fcypress-plugin-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filiphric%2Fcypress-plugin-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/filiphric","download_url":"https://codeload.github.com/filiphric/cypress-plugin-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filiphric%2Fcypress-plugin-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278556335,"owners_count":26006125,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","cypress","cypress-io","testing"],"created_at":"2025-06-11T04:17:25.638Z","updated_at":"2025-10-06T04:08:26.887Z","avatar_url":"https://github.com/filiphric.png","language":"TypeScript","funding_links":["https://github.com/sponsors/filiphric","https://filiphric.com/workshops"],"categories":[],"sub_categories":[],"readme":"\u003ch2 align=center\u003eCypress plugin API\u003c/h2\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/sponsors/filiphric\"\u003e\u003cimg src=\"https://img.shields.io/static/v1?label=Sponsor\u0026message=%E2%9D%A4\u0026logo=GitHub\u0026color=%23fe8e86\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://dashboard.cypress.io/projects/v2x96h/runs\"\u003e\u003cimg src=\"https://img.shields.io/endpoint?url=https://dashboard.cypress.io/badge/count/v2x96h/main\u0026style=flat\u0026logo=cypress\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\nCypress plugin for effective API testing. Imagine Postman, but in Cypress. Prints out information about the API call in the Cypress App UI.\n\u003c/p\u003e\n\n![Cypress plugin for testing API](./images/demo.gif)\n\n### Features\n- cy.api() command, that will information about the API call, such as URL, headers, response and more to the UI frame\n- all of the info can be viewed in a time-travel snapshots\n- simple table for viewing cookies\n- JSON data object and array folding\n- color coding of methods in UI view and in timeline\n- calculating size of the response\n- [combine API calls with UI](#snapshot-only-mode)\n- [hide sensitive headers and auth information](#hiding-credentials)\n- [`requestMode` to add cy.api() features to cy.request() command](#requestmode---enable-ui-for-cyrequest-command)\n- [TypeScript support](#typescript-support)\n\n### Installation\n\nInstall this package:\n```bash\nnpm i cypress-plugin-api\n# or\nyarn add cypress-plugin-api\n```\n\nImport the plugin into your `cypress/support/e2e.js` file:\n```js\nimport 'cypress-plugin-api'\n// or\nrequire('cypress-plugin-api')\n```\n\n### Usage\nYou can now use `cy.api()` command. This command works exactly like `cy.request()` but in addition to calling your API, it will print our information about the API call in your Cypress runner.\n\n#### Snapshot only mode\nIf you want to combine your API calls with your UI test, you can now use `snapshotOnly` mode, that will hide the plugin UI view after command ends. You can access it within the timeline.\n\n`snapshotOnly` mode is set to `false` by default. To set up `snapshotOnly` mode, add following to your test configuration:\n\n```js\nit('my UI \u0026 API test', { env: { snapshotOnly: true } }, () =\u003e {\n\n  cy.visit('/') // open app\n  cy.api('/item') // call api\n  cy.get('#myElement') // still able to access element on page\n\n})\n```\n\nor you can add the configuration to your `cypress.config.{js,ts}` file:\n```js\nimport { defineConfig } from 'cypress'\n\nexport default defineConfig({\n  e2e: {\n    setupNodeEvents(on, config) {\n    },\n    env: {\n      snapshotOnly: true\n    }\n  },\n})\n```\n\n#### Hiding credentials\nYou can hide your credentials by passing `hideCredentials` option to your env configuration. This will hide all the credentials from UI, but you can still access them via console. This option is set to `false` by default.\n\n```js\nit('my secret test', { env: { hideCredentials: true } }, () =\u003e {\n\n  cy.api({\n      url: '/',\n      headers: {\n        authorization: Cypress.env('myToken')\n      }\n    })\n\n})\n```\n\nThe result will look like this:\n\n![Cypress plugin for testing API](./images/hideCredentials.png)\n\nYou can also hide any credentials you want by defining array of keys in `hideCredentialsOptions`,\n\n```js\nit('my secret test', { \n  env: { \n    hideCredentials: true, \n    hideCredentialsOptions: {\n      headers: ['authorization'],\n      auth: ['pass'],\n      body: ['username'],\n      query: ['password']\n    }\n  }\n}, () =\u003e {\n\n  cy.api({\n      url: '/',\n      headers: {\n        authorization: Cypress.env('myToken') // hidden\n      },\n      auth: {\n        pass: Cypress.env('myPass') // hidden\n      },\n      body: {\n        username: Cypress.env('myUser') // hidden\n      },\n      qs: {\n        password: Cypress.env('password') // hidden\n      }\n    })\n\n})\n```\n\nThis will override all the defaults set by `hideCredentials`.\n\n#### `requestMode` - enable UI for `cy.request()` command\nThis setting adds all the functionality of `cy.api()` command to `cy.request()`. It’s set to `false` by default. This means that when you call `cy.request()` in your test, it will show UI.\n\n#### TypeScript support\nIn most cases, types work just by installing plugin, but you can add the types to your `tsconfig.json`\n```json\n{\n  \"types\": [\"cypress-plugin-api\"]\n}\n```\nThis will add types for `cy.api()` command, it’s returned values as well as `env` properties.\n\n### Issues\nAll the issues can be found on [issues page](https://github.com/filiphric/cypress-plugin-api/issues), feel free to open any new ones or contribute with your own code.\n\n\u003c!-- ### Want to learn more?\nCome to my upcoming \"Testing API with Cypress\" workshop. We’ll be using this plugin and learning different ways of testing API.\n\n[Register here](https://filiphric.com/cypress-api-testing-workshop)\n\n![Testing API with Cypress workshop](./images/apiWorkshop.png) --\u003e\n\u003chr\u003e\n\u003cp align=\"center\"\u003e\n...powered by coffee and love ❤️  \u003ca href=\"https://filiphric.com\"\u003eFilip Hric\n\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiliphric%2Fcypress-plugin-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffiliphric%2Fcypress-plugin-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiliphric%2Fcypress-plugin-api/lists"}