{"_id":"@bytescoutai/nextjs","_rev":"5-45821dc7b2a6af953a43fa7fc8b59e2e","name":"@bytescoutai/nextjs","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"@bytescoutai/nextjs","version":"1.0.0","keywords":["nextjs","sdk","api","bytescout"],"author":{"name":"ByteScout"},"license":"MIT","_id":"@bytescoutai/nextjs@1.0.0","maintainers":[{"name":"totaylor","email":"totaylor19@gmail.com"}],"homepage":"https://github.com/0xtotaylor/nextjs-bytescout#readme","bugs":{"url":"https://github.com/0xtotaylor/nextjs-bytescout/issues"},"dist":{"shasum":"68988866588ff4ca342cc51899fbfc20acd61397","tarball":"https://registry.npmjs.org/@bytescoutai/nextjs/-/nextjs-1.0.0.tgz","fileCount":11,"integrity":"sha512-qcXsWqpDQNdBI8tPuM5s+q1rr1MgzaHpysbYIEwbJrPB+dnKJhF2TGrrBrAnH3BvaTumpsGv4e085YOYhkeLWg==","signatures":[{"sig":"MEYCIQDm/0vw/kJ5J+kBx1Eq/aHck7fObH+JduWJfeTzEKGd9wIhAMEcof8DdxmqtMu9MoTfBVfffrnN/gOokpihDuA1zXCr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14848},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"9e53873e9fcc2cb3ef6a385f839fb7ecff23ab63","scripts":{"build":"npx tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"totaylor","email":"totaylor19@gmail.com"},"repository":{"url":"git+https://github.com/0xtotaylor/nextjs-bytescout.git","type":"git"},"_npmVersion":"10.8.2","description":"Official ByteScout SDK for Next.js","directories":{},"_nodeVersion":"22.8.0","dependencies":{"cheerio":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.2","@types/next":"^9.0.0","@types/node":"^22.5.5","@types/react":"^18.3.7","@types/react-dom":"^18.3.0"},"peerDependencies":{"next":">=13.0.0","react":">=16.8.0","react-dom":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/nextjs_1.0.0_1727125593931_0.22432363241579045","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@bytescoutai/nextjs","version":"1.0.1","keywords":["nextjs","sdk","api","bytescout"],"author":{"name":"ByteScout"},"license":"MIT","_id":"@bytescoutai/nextjs@1.0.1","maintainers":[{"name":"totaylor","email":"totaylor19@gmail.com"}],"homepage":"https://github.com/0xtotaylor/nextjs-bytescout#readme","bugs":{"url":"https://github.com/0xtotaylor/nextjs-bytescout/issues"},"dist":{"shasum":"ef76777945baacaec75c35b12e8d7c5d4b6774fa","tarball":"https://registry.npmjs.org/@bytescoutai/nextjs/-/nextjs-1.0.1.tgz","fileCount":11,"integrity":"sha512-WazDB2WjDMaLFJw+xKkslbA97NCG07DxhkSupm//Qqji7HORIOzmPJIZHKClUWeMTAJOUg+7BocD9KDmCwTnSA==","signatures":[{"sig":"MEUCIQDhWYN67RApnyFVoVV4IUbzoWMQJFvB13TXyXK24HVmCgIgLPL8hjKxZf3Cdi/eTcG8FGEm8NIANj9iPxsnl8fki34=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14848},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"9e53873e9fcc2cb3ef6a385f839fb7ecff23ab63","scripts":{"build":"npx tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"totaylor","email":"totaylor19@gmail.com"},"repository":{"url":"git+https://github.com/0xtotaylor/nextjs-bytescout.git","type":"git"},"_npmVersion":"10.8.2","description":"Official ByteScout SDK for Next.js","directories":{},"_nodeVersion":"22.8.0","dependencies":{"cheerio":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.2","@types/next":"^9.0.0","@types/node":"^22.5.5","@types/react":"^18.3.7","@types/react-dom":"^18.3.0"},"peerDependencies":{"next":">=13.0.0","react":">=16.8.0","react-dom":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/nextjs_1.0.1_1727125645945_0.6700425390731581","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@bytescoutai/nextjs","version":"1.0.2","keywords":["nextjs","sdk","api","bytescout"],"author":{"name":"ByteScout"},"license":"MIT","_id":"@bytescoutai/nextjs@1.0.2","maintainers":[{"name":"totaylor","email":"totaylor19@gmail.com"}],"homepage":"https://github.com/0xtotaylor/bytescout-nextjs#readme","bugs":{"url":"https://github.com/0xtotaylor/bytescout-nextjs/issues"},"dist":{"shasum":"ea8cee077f74bda01b6ec5e339c550ce162a3dd0","tarball":"https://registry.npmjs.org/@bytescoutai/nextjs/-/nextjs-1.0.2.tgz","fileCount":9,"integrity":"sha512-Cqiby3PnRDQ/DKu/7ZApKRwX+bpYZUVQjXH0GygsWRzHTIng3g2qyqcV2V7lHR6+jd1KwDmplCi2cS4dJQc2gA==","signatures":[{"sig":"MEQCIHcBT+/WnscljuBZz4JgZ38cdcjJqGkuyBjk+kbsUeLUAiBfJNAWcCTqPwa9jA8GSLAxtIZIy4Vr75LtO3JXRR/gbg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13765},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"24b51db9c0c18a236638acf01f6e4e594efa7f6f","scripts":{"build":"npx tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"totaylor","email":"totaylor19@gmail.com"},"repository":{"url":"git+https://github.com/0xtotaylor/bytescout-nextjs.git","type":"git"},"_npmVersion":"10.8.2","description":"Official ByteScout SDK for Next.js","directories":{},"_nodeVersion":"22.8.0","dependencies":{"cheerio":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.2","@types/next":"^9.0.0","@types/node":"^22.5.5","@types/react":"^18.3.7","@types/react-dom":"^18.3.0"},"peerDependencies":{"next":">=13.0.0","react":">=16.8.0","react-dom":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/nextjs_1.0.2_1727127353728_0.42978910703898765","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@bytescoutai/nextjs","version":"1.0.3","keywords":["nextjs","sdk","api","bytescout"],"author":{"name":"ByteScout"},"license":"MIT","_id":"@bytescoutai/nextjs@1.0.3","maintainers":[{"name":"totaylor","email":"totaylor19@gmail.com"}],"homepage":"https://github.com/0xtotaylor/bytescout-nextjs#readme","bugs":{"url":"https://github.com/0xtotaylor/bytescout-nextjs/issues"},"dist":{"shasum":"17d1044e280abae4751840384054c4a53a74dde0","tarball":"https://registry.npmjs.org/@bytescoutai/nextjs/-/nextjs-1.0.3.tgz","fileCount":9,"integrity":"sha512-/H5kvvkVFn41+nHju7uNhOrPTqHHAKtxQoLw9y7AT9O64odb1rT0VG0KsDMlsivWfmoc2mcT4Fp/hTyjGiyEKw==","signatures":[{"sig":"MEUCIF1lgHGLr3qundDqrMbJYMbnfgO7KLjAqouNtJ/wceNzAiEAjiCp/ynP+iZFYE/qeW/zxDh6/Yp4sxF4D646c0eCtv4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14149},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"8b2b048520c15f008babc5c3615af4a760cbb7da","scripts":{"build":"npx tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"totaylor","email":"totaylor19@gmail.com"},"repository":{"url":"git+https://github.com/0xtotaylor/bytescout-nextjs.git","type":"git"},"_npmVersion":"10.8.2","description":"Official ByteScout SDK for Next.js","directories":{},"_nodeVersion":"22.8.0","dependencies":{"cheerio":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.2","@types/next":"^9.0.0","@types/node":"^22.5.5","@types/react":"^18.3.7","@types/react-dom":"^18.3.0"},"peerDependencies":{"next":">=13.0.0","react":">=16.8.0","react-dom":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/nextjs_1.0.3_1727276557337_0.667567402001165","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@bytescoutai/nextjs","version":"1.0.4","keywords":["nextjs","sdk","api","bytescout"],"author":{"name":"ByteScout"},"license":"MIT","_id":"@bytescoutai/nextjs@1.0.4","maintainers":[{"name":"totaylor","email":"totaylor19@gmail.com"}],"homepage":"https://github.com/0xtotaylor/bytescout-nextjs#readme","bugs":{"url":"https://github.com/0xtotaylor/bytescout-nextjs/issues"},"dist":{"shasum":"6eee7d89d680d9b18cdc20d8995b21c1ace4dae9","tarball":"https://registry.npmjs.org/@bytescoutai/nextjs/-/nextjs-1.0.4.tgz","fileCount":9,"integrity":"sha512-J+VVl1ZlRXTefU5Cj/FQBAIJh8IvjmYcDQyqPlSfDf2ZYEH/qxLXkk3ppq/jmXjcu1NPUfC+7BOieMz3CrjCvw==","signatures":[{"sig":"MEUCIAzOvUups+xwOfn3u80ez+3nFMe4+v8EUwrP+NVejn28AiEA2jTifrbzhqGMmB3PJWIP+pXQRuwizIvqoW/bZ64crOY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15267},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"d4e2b6b23871d2156e36629957d8b9a1010a34da","scripts":{"build":"npx tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"totaylor","email":"totaylor19@gmail.com"},"repository":{"url":"git+https://github.com/0xtotaylor/bytescout-nextjs.git","type":"git"},"_npmVersion":"10.8.2","description":"Official ByteScout SDK for Next.js","directories":{},"_nodeVersion":"22.8.0","dependencies":{"cheerio":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.2","@types/next":"^9.0.0","@types/node":"^22.5.5","@types/react":"^18.3.7","@types/react-dom":"^18.3.0"},"peerDependencies":{"next":">=13.0.0","react":">=16.8.0","react-dom":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/nextjs_1.0.4_1727305415313_0.535184875700695","host":"s3://npm-registry-packages"}},"1.0.5":{"name":"@bytescoutai/nextjs","version":"1.0.5","description":"ByteScout SDK for Next.js","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"npx tsc","prepublishOnly":"npm run build"},"keywords":["nextjs","sdk","api","bytescout"],"author":{"name":"ByteScout"},"license":"MIT","peerDependencies":{"next":">=13.0.0","react":">=16.8.0","react-dom":">=16.8.0"},"devDependencies":{"@types/next":"^9.0.0","@types/node":"^22.5.5","@types/react":"^18.3.7","@types/react-dom":"^18.3.0","typescript":"^5.6.2"},"dependencies":{"cheerio":"^1.0.0"},"repository":{"type":"git","url":"git+https://github.com/0xtotaylor/bytescout-nextjs.git"},"bugs":{"url":"https://github.com/0xtotaylor/bytescout-nextjs/issues"},"homepage":"https://github.com/0xtotaylor/bytescout-nextjs#readme","_id":"@bytescoutai/nextjs@1.0.5","gitHead":"506e02fe0bbaef247ab9d59df7e48847caf3c54e","_nodeVersion":"22.8.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-Hdb7Tjmm3epb9vomBjIibCLqq3oC1N7Itt0Qu7Ib9kF4PPrUYnQn+gkD7eUGp5Vl+iRyk02YQu9wo+kLMd4MFg==","shasum":"f434e16f56dbfbafc1779fd240b017704087db4a","tarball":"https://registry.npmjs.org/@bytescoutai/nextjs/-/nextjs-1.0.5.tgz","fileCount":9,"unpackedSize":15261,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCatKG8k0AYfasP9yUFctP/FzSSN/zvC3/hw6jAbS84nwIgTZAjfZTClOTIezfrsx913HmbBPk0J99sezhDOj/o9wg="}]},"_npmUser":{"name":"totaylor","email":"totaylor19@gmail.com"},"directories":{},"maintainers":[{"name":"totaylor","email":"totaylor19@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nextjs_1.0.5_1727447728228_0.3028601814543095"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-23T21:06:33.841Z","modified":"2024-09-27T14:35:28.614Z","1.0.0":"2024-09-23T21:06:34.138Z","1.0.1":"2024-09-23T21:07:26.136Z","1.0.2":"2024-09-23T21:35:54.044Z","1.0.3":"2024-09-25T15:02:37.501Z","1.0.4":"2024-09-25T23:03:35.654Z","1.0.5":"2024-09-27T14:35:28.416Z"},"bugs":{"url":"https://github.com/0xtotaylor/bytescout-nextjs/issues"},"author":{"name":"ByteScout"},"license":"MIT","homepage":"https://github.com/0xtotaylor/bytescout-nextjs#readme","keywords":["nextjs","sdk","api","bytescout"],"repository":{"type":"git","url":"git+https://github.com/0xtotaylor/bytescout-nextjs.git"},"description":"ByteScout SDK for Next.js","maintainers":[{"name":"totaylor","email":"totaylor19@gmail.com"}],"readme":"# ByteScout SDK for Next.js\n\nThis open source SDK provides an easy way to automatically generate API endpoints for your Next.js pages and optionally cache responses for improved performance. It also includes support for specifying a Skyfire receiver username for potential integration with Skyfire payments.\n\n## Installation\n\n1. Install the SDK in your Next.js project:\n\n```bash\nnpm install @bytescoutai/nextjs\n# or\nyarn add @bytescoutai/nextjs\n```\n\n## Usage\n\n### 1. Configure Next.js\n\nModify your `next.config.js` or `next.config.ts` file to use the `withAutoApi` function:\n\n```javascript\nimport { withAutoApi } from \"@bytescoutai/nextjs\";\n\nconst nextConfig = {\n  // Your existing Next.js configuration\n};\n\nconst autoApiConfig = {\n  enabled: true,\n  apiPrefix: \"/api\",\n  excludePaths: [\"/private\"],\n  enableCache: true,\n  cacheDuration: 3600,\n  receiverUsername: \"your-skyfire-username\", // Add this line for Skyfire monetization\n};\n\nexport default withAutoApi(nextConfig, autoApiConfig);\n```\n\n### 2. Set up Middleware\n\nCreate or modify `middleware.ts` in the root of your project:\n\n```typescript\nimport { AutoApiConfig, withAutoApiMiddleware } from \"@bytescoutai/nextjs\";\n\nconst autoApiConfig: AutoApiConfig = {\n  enabled: true,\n  apiPrefix: \"/api\",\n  excludePaths: [\"/private\"],\n  enableCache: true,\n  cacheDuration: 3600,\n  receiverUsername: \"your-skyfire-username\", // Add this line for Skyfire monetization\n};\n\nexport default withAutoApiMiddleware(autoApiConfig);\n\nexport const config = {\n  matcher: \"/:path*\",\n};\n```\n\n## How It Works\n\n- The SDK automatically generates API endpoints for your Next.js pages.\n- Access page data by appending your `apiPrefix` to the page path (e.g., `/api/public` for `/public/page.ts`).\n- Responses can be cached for improved performance.\n- If specified, the Skyfire receiver username is included in the API responses.\n\n## Configuration Options\n\n| Option              | Type     | Default  | Description                                             |\n| ------------------- | -------- | -------- | ------------------------------------------------------- |\n| `enabled`           | boolean  | `true`   | Enable or disable the Auto API functionality            |\n| `apiPrefix`         | string   | `\"/api\"` | Prefix for the API endpoints                            |\n| `excludePaths`      | string[] | `[]`     | Paths to exclude from Auto API processing               |\n| `enableCache`       | boolean  | `false`  | Enable or disable caching of API responses              |\n| `cacheDuration`     | number   | `3600`   | Duration (in seconds) for which cache entries are valid |\n| `additionalHeaders` | object   | `{}`     | Additional headers to include in the API response       |\n| `receiverUsername`  | string   | ``       | Username of the Skyfire receiver agent                  |\n\n## Skyfire Integration\n\nThe SDK includes support for specifying a Skyfire receiver username. This username is included in the API responses and can be used as an identifier for potential Skyfire payment integrations.\n\nTo use this feature:\n\n1. Set the `receiverUsername` in your `autoApiConfig`.\n2. The username will be included in the `PageData` object returned by API requests.\n3. You can use this username in your custom payment processing logic to identify the Skyfire receiver.\n\nNote: The SDK does not implement Skyfire payment processing directly. You will need to implement your own payment logic using the provided `receiverUsername`.\n\n## Support\n\nFor issues, feature requests, or questions, please [open an issue](https://github.com/0xtotaylor/bytescout-nextjs/issues) on our GitHub repository.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","readmeFilename":"README.md"}