{"_id":"@apiuikit/openapi-try-it-plugin","_rev":"3-bbd48a9ee0ea7d38dba547bb64311a03","name":"@apiuikit/openapi-try-it-plugin","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"@apiuikit/openapi-try-it-plugin","version":"0.1.0","license":"Apache-2.0","_id":"@apiuikit/openapi-try-it-plugin@0.1.0","maintainers":[{"name":"_acedcreator","email":"ea.elegbede@gmail.com"},{"name":"catosaurusrex2003","email":"mohdmehdi2003@gmail.com"}],"homepage":"https://github.com/apiuikit/openapi-try-it-plugin#readme","bugs":{"url":"https://github.com/apiuikit/openapi-try-it-plugin/issues"},"dist":{"shasum":"bf9faf7a80c67a3b7e03ab26a8ab15ee4cbc2b2e","tarball":"https://registry.npmjs.org/@apiuikit/openapi-try-it-plugin/-/openapi-try-it-plugin-0.1.0.tgz","fileCount":40,"integrity":"sha512-YY+drLyUyuS+hdsIoJw6wgf+3uBSH0F3HTjzPK64yeM1I1pflEyUwCe7ORkJCjcbK5dPqALrUCp6aBi6fYhm6w==","signatures":[{"sig":"MEUCIQChYrkwcepXbuq6JIN2QuSvgIqG0wczop1glRvsrh8JlwIgPhobR38nAnSn/5jwcmwq8vAZJVOnvWdRrT14c7MaMqM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":466933},"main":"./dist/openapi-try-it-plugin.cjs.js","type":"module","types":"./dist/index.d.ts","module":"./dist/openapi-try-it-plugin.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/openapi-try-it-plugin.es.js","require":"./dist/openapi-try-it-plugin.cjs.js"}},"gitHead":"92906871fb122176ce1375c04b309de2e3921906","scripts":{"dev":"vite build --watch","lint":"eslint .","test":"vitest run","build":"vite build","release":"changeset publish","changeset":"changeset","typecheck":"tsc -b","test:watch":"vitest","prepublishOnly":"npm run build","version-packages":"changeset version"},"_npmUser":{"name":"catosaurusrex2003","email":"mohdmehdi2003@gmail.com"},"repository":{"url":"git+https://github.com/apiuikit/openapi-try-it-plugin.git","type":"git"},"_npmVersion":"10.9.2","description":"A \"Try it out\" request-sending plugin for apiuikit, filling the openapi.operation.tab slot.","directories":{},"sideEffects":false,"_nodeVersion":"22.16.0","dependencies":{"@microlink/react-json-view":"^1.31.28"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.5","jsdom":"^29.1.1","react":"^19.0.0","eslint":"^9.17.0","vitest":"^4.1.10","globals":"^15.14.0","apiuikit":"^1.7.0","react-dom":"^19.0.0","@eslint/js":"^9.17.0","typescript":"~5.6.2","@types/react":"^19.0.0","@changesets/cli":"^2.31.0","vite-plugin-dts":"^5.0.3","@types/react-dom":"^19.0.0","typescript-eslint":"^8.18.2","@vitejs/plugin-react":"^4.3.4","eslint-plugin-react-hooks":"^5.0.0"},"peerDependencies":{"react":">=18","apiuikit":"^1.7.0","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/openapi-try-it-plugin_0.1.0_1788620597466_0.37696457335873323","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@apiuikit/openapi-try-it-plugin","version":"0.2.0","license":"Apache-2.0","_id":"@apiuikit/openapi-try-it-plugin@0.2.0","maintainers":[{"name":"_acedcreator","email":"ea.elegbede@gmail.com"},{"name":"catosaurusrex2003","email":"mohdmehdi2003@gmail.com"}],"homepage":"https://github.com/apiuikit/openapi-try-it-plugin#readme","bugs":{"url":"https://github.com/apiuikit/openapi-try-it-plugin/issues"},"dist":{"shasum":"f2e6b5fca25a62d5493819b4467375723a3c6604","tarball":"https://registry.npmjs.org/@apiuikit/openapi-try-it-plugin/-/openapi-try-it-plugin-0.2.0.tgz","fileCount":44,"integrity":"sha512-ZY33dPS8HwOOiga6J+A84v1IWC5RC3hWD3qejbb5GVvA+RMJhzQClNpsC7qqqv86j8O4G/db1isRVd9LDBC1KA==","signatures":[{"sig":"MEUCICENS59LXGG2ELFFoINtGroevrp/oMWqx89fzaNix1h1AiEAiI2ZHpMEkd1XlkP0gFcSgbuxhOv17mZDZwA1OA+1sCY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apiuikit%2fopenapi-try-it-plugin@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":489375},"main":"./dist/openapi-try-it-plugin.cjs.js","type":"module","types":"./dist/index.d.ts","module":"./dist/openapi-try-it-plugin.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/openapi-try-it-plugin.es.js","require":"./dist/openapi-try-it-plugin.cjs.js"}},"gitHead":"48e6bcd846c5eb63ad4b89d2df968e8ed6c56cf1","scripts":{"dev":"vite build --watch","lint":"eslint .","test":"vitest run","build":"vite build","release":"changeset publish","changeset":"changeset","typecheck":"tsc -b","test:watch":"vitest","prepublishOnly":"npm run build","version-packages":"changeset version"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:03b9b6cf-a73d-4aeb-a20f-bb9ad84f261c"}},"repository":{"url":"git+https://github.com/apiuikit/openapi-try-it-plugin.git","type":"git"},"_npmVersion":"11.19.0","description":"A \"Try it out\" request-sending plugin for apiuikit, filling the openapi.operation.tab slot.","directories":{},"sideEffects":false,"_nodeVersion":"24.20.0","dependencies":{"@microlink/react-json-view":"^1.31.28"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.5","jsdom":"^29.1.1","react":"^19.0.0","eslint":"^9.17.0","vitest":"^4.1.10","globals":"^15.14.0","apiuikit":"^1.7.0","react-dom":"^19.0.0","@eslint/js":"^9.17.0","typescript":"~5.6.2","@types/react":"^19.0.0","@changesets/cli":"^2.31.0","vite-plugin-dts":"^5.0.3","@types/react-dom":"^19.0.0","typescript-eslint":"^8.18.2","@vitejs/plugin-react":"^4.3.4","eslint-plugin-react-hooks":"^5.0.0"},"peerDependencies":{"react":">=18","apiuikit":"^1.7.0","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/openapi-try-it-plugin_0.2.0_1788705594960_0.048579349256804294","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"_id":"@apiuikit/openapi-try-it-plugin@0.2.1","bugs":{"url":"https://github.com/apiuikit/openapi-try-it-plugin/issues"},"dist":{"shasum":"25f8df200c8281aa5cca88bf15524563e8ff49a1","tarball":"https://registry.npmjs.org/@apiuikit/openapi-try-it-plugin/-/openapi-try-it-plugin-0.2.1.tgz","fileCount":44,"integrity":"sha512-4kCi1hjPjsr9prBB3HhcMhxV3fiieqObKIzdo0h0gnhlJy6BNlLhitWlbCDJezDKFihGpX6n7aZeeUMTAxiH1g==","signatures":[{"sig":"MEUCIQDMSnKCptlWityuAYYv7HD7o1fvFwKRdD1/GMk4RLOGuAIgE0TZlVnPUJNSZNouKOe1W7snfgP5Xuqj9ThQb4aOFpw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGi/o8a0Kieh0hNJ2bDde1Ogo/PvlWbMyfQ2ZTtH7UlxAiAtZQQsadWu0IdmBg5zXT2DrXeojX7GqvsTHPwqzb8DHg=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apiuikit%2fopenapi-try-it-plugin@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":490709},"main":"./dist/openapi-try-it-plugin.cjs.js","name":"@apiuikit/openapi-try-it-plugin","type":"module","types":"./dist/index.d.ts","module":"./dist/openapi-try-it-plugin.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/openapi-try-it-plugin.es.js","require":"./dist/openapi-try-it-plugin.cjs.js"}},"gitHead":"83e631f8bc2d554678fa2a8f61a66228885eae29","license":"Apache-2.0","scripts":{"dev":"vite build --watch","lint":"eslint .","test":"vitest run","build":"vite build","release":"changeset publish","changeset":"changeset","typecheck":"tsc -b","test:watch":"vitest","prepublishOnly":"npm run build","version-packages":"changeset version"},"version":"0.2.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:03b9b6cf-a73d-4aeb-a20f-bb9ad84f261c"}},"homepage":"https://github.com/apiuikit/openapi-try-it-plugin#readme","repository":{"url":"git+https://github.com/apiuikit/openapi-try-it-plugin.git","type":"git"},"_npmVersion":"11.19.0","description":"A \"Try it out\" request-sending plugin for apiuikit, filling the openapi.operation.tab slot.","directories":{},"maintainers":[{"name":"_acedcreator","email":"ea.elegbede@gmail.com"},{"name":"catosaurusrex2003","email":"mohdmehdi2003@gmail.com"}],"sideEffects":false,"_nodeVersion":"24.20.0","dependencies":{"@microlink/react-json-view":"^1.31.28"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.5","jsdom":"^29.1.1","react":"^19.0.0","eslint":"^9.17.0","vitest":"^4.1.10","globals":"^15.14.0","apiuikit":"^1.10.0","react-dom":"^19.0.0","@eslint/js":"^9.17.0","typescript":"~5.6.2","@types/react":"^19.0.0","@changesets/cli":"^2.31.0","vite-plugin-dts":"^5.0.3","@types/react-dom":"^19.0.0","typescript-eslint":"^8.18.2","@vitejs/plugin-react":"^4.3.4","eslint-plugin-react-hooks":"^5.0.0"},"peerDependencies":{"react":">=18","apiuikit":"^1.10.0","react-dom":">=18"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/openapi-try-it-plugin_0.2.1_1789138580511_0.10390806582191736"}}},"time":{"created":"2026-09-05T15:03:17.262Z","modified":"2026-09-11T14:56:21.069Z","0.1.0":"2026-09-05T15:03:17.608Z","0.2.0":"2026-09-06T14:39:55.100Z","0.2.1":"2026-09-11T14:56:20.601Z"},"bugs":{"url":"https://github.com/apiuikit/openapi-try-it-plugin/issues"},"license":"Apache-2.0","homepage":"https://github.com/apiuikit/openapi-try-it-plugin#readme","repository":{"url":"git+https://github.com/apiuikit/openapi-try-it-plugin.git","type":"git"},"description":"A \"Try it out\" request-sending plugin for apiuikit, filling the openapi.operation.tab slot.","maintainers":[{"name":"_acedcreator","email":"ea.elegbede@gmail.com"},{"name":"catosaurusrex2003","email":"mohdmehdi2003@gmail.com"}],"readme":"# OpenAPI Try it\n\n[![npm version](https://img.shields.io/npm/v/@apiuikit/openapi-try-it-plugin.svg?label=%40apiuikit%2Fopenapi-try-it-plugin)](https://www.npmjs.com/package/@apiuikit/openapi-try-it-plugin)\n[![npm downloads](https://img.shields.io/npm/dm/@apiuikit/openapi-try-it-plugin.svg)](https://www.npmjs.com/package/@apiuikit/openapi-try-it-plugin)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE)\n[![Docs](https://img.shields.io/badge/docs-apiuikit.com-1473FF.svg)](https://apiuikit.com/plugins/openapi-try-it)\n\nA \"Try it out\" plugin for [apiuikit](https://apiuikit.com). Fill in parameters, auth, and a body, send the request, and inspect the response — from the docs.\n\nThis package is not bundled with apiuikit. Install it and pass it as a plugin.\n\n## Install\n\n```sh\nnpm install @apiuikit/openapi-try-it-plugin\n```\n\nPeer dependencies: `apiuikit` ^1.7, React 18+.\n\n## Usage\n\nTwo layouts — register either, or both.\n\nKeep the `plugins` array stable by defining it outside the component or with `useMemo`. A new array on every render re-registers the plugins and can reset the selected tab.\n\nYou can pass `plugins` to `OpenAPI`, `OpenAPIRenderer`, `OpenAPIProvider`, or a standalone section that receives a `document` prop. When a section is inside a provider, it uses the provider's plugins.\n\n### Tab (default)\n\nFills the [`openapi.operation.tab`](https://apiuikit.com/docs/plugins#add-a-full-operation-tab) slot — a **Try it** tab next to the built-in Reference tab.\n\n![The Try it tab: request URL, parameters, auth, body, and Send](docs/tab.png)\n\n```tsx\nimport { OpenAPI } from \"apiuikit\";\nimport tryItPlugin from \"@apiuikit/openapi-try-it-plugin\";\nimport \"apiuikit/style.css\";\nimport doc from \"./openapi.json\";\n\nconst plugins = [tryItPlugin];\n\nexport default function App() {\n  return <OpenAPI openapi={doc} plugins={plugins} />;\n}\n```\n\n### Button\n\nFills the [`openapi.operation.reference.supplementary`](https://apiuikit.com/docs/plugins#add-supplementary-inline-content) slot — a **Try it** row on the Path side panel. Clicking it opens a modal with the request on the left and the response on the right.\n\n![A Try it row on the Reference panel, between the example request and authorization](docs/button.png)\n\n![The Try it modal: request builder on the left, response on the right](docs/button-modal.png)\n\n```tsx\nimport { OpenAPI } from \"apiuikit\";\nimport { createTryItButtonPlugin } from \"@apiuikit/openapi-try-it-plugin\";\nimport \"apiuikit/style.css\";\nimport doc from \"./openapi.json\";\n\nconst plugins = [createTryItButtonPlugin()];\n\nexport default function App() {\n  return <OpenAPI openapi={doc} plugins={plugins} />;\n}\n```\n\n### Both\n\n```tsx\nimport tryItPlugin, { createTryItButtonPlugin } from \"@apiuikit/openapi-try-it-plugin\";\n\nconst plugins = [tryItPlugin, createTryItButtonPlugin()];\n```\n\n## CORS\n\nRequests go from the browser. If the API does not allow your origin, the browser will block them.\n\nThis package does not ship a proxy. If you have one, pass it:\n\n```tsx\nimport { createTryItPlugin } from \"@apiuikit/openapi-try-it-plugin\";\n\nconst plugins = [createTryItPlugin({ proxyUrl: \"https://your-proxy.example.com/tryit\" })];\n```\n\nRequests then go to `${proxyUrl}?target=<url-encoded API URL>` instead of the API origin.\n\n`createTryItButtonPlugin` accepts the same `proxyUrl` option.\n\n## Supported auth\n\n| Scheme | Behavior |\n| --- | --- |\n| API key (header / query) | Input field |\n| HTTP Bearer | Token input |\n| HTTP Basic | Username + password |\n| OAuth2 client credentials | Fetches a token from the token URL |\n| OAuth2 authorization code (+ PKCE) | Login popup, then token exchange |\n| Other OAuth2 / OpenID Connect | Paste a token obtained elsewhere |\n\nOAuth2 authorization-code redirect URIs must be same-origin with the page hosting apiuikit.\n\nCookie API keys cannot be sent from the browser (`Cookie` is a forbidden Fetch header).\n\n## Export\n\nAfter building a request, export it as a Postman collection, an Insomnia collection, or a HAR file from the **Export** menu.\n\n## Development\n\n```sh\nnpm install\nnpm run test\nnpm run typecheck\nnpm run build\n```\n\nManual QA against the apiuikit playground: [TESTING.md](./TESTING.md).\n","readmeFilename":"README.md"}