{"_id":"@anycade/sdk","_rev":"5-048b90003b38ac509f9e5fcb0ca3e77d","name":"@anycade/sdk","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.1":{"name":"@anycade/sdk","version":"0.0.1","keywords":["anycade","anycade games","sdk"],"license":"MIT","_id":"@anycade/sdk@0.0.1","maintainers":[{"name":"mvrlin","email":"mamuco@mail.ru"}],"homepage":"https://github.com/Anycade/sdk#readme","bugs":{"url":"https://github.com/Anycade/sdk/issues"},"dist":{"shasum":"c86afca4ade5fad66ba79f67bed7232f694d8dbf","tarball":"https://registry.npmjs.org/@anycade/sdk/-/sdk-0.0.1.tgz","fileCount":7,"integrity":"sha512-f5sculHAvC+hYvo3+r+ZHl7GKZmqYvyNebSlk7j3PsQrdg6GHPAnSTyGomn2DX+8EKQICFHmDH/IsVnpvpAiIA==","signatures":[{"sig":"MEUCIQCdU0KmYjxAB+zeFVfIe3VORgfT4ylHosB5eF/gZ8fKIQIgXGD4iZE3/4A68zOdEvH2bqnrAuLLywFGjV7DZ8Zlfnw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15467},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"7b5972789fdd95da4b90ee39bca449bc4327b9a1","scripts":{"dev":"vite","test":"vitest","build":"tsdown","dev:build":"vite build","dev:start":"vite preview"},"_npmUser":{"name":"mvrlin","email":"mamuco@mail.ru"},"repository":{"url":"git+https://github.com/Anycade/sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Anycade SDK","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"vite":"7.2.2","eslint":"9.37.0","tsdown":"0.15.6","vitest":"3.2.4","globals":"16.4.0","prettier":"3.6.2","typescript":"5.9.3","@types/node":"24.7.1","eslint-config-prettier":"10.1.8","eslint-plugin-prettier":"5.5.4","@typescript-eslint/parser":"8.46.0","eslint-plugin-perfectionist":"4.15.1","@typescript-eslint/eslint-plugin":"8.46.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.0.1_1763220417610_0.11521104216927514","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@anycade/sdk","version":"0.0.2","keywords":["anycade","anycade games","sdk"],"license":"MIT","_id":"@anycade/sdk@0.0.2","maintainers":[{"name":"mvrlin","email":"mamuco@mail.ru"}],"homepage":"https://github.com/Anycade/sdk#readme","bugs":{"url":"https://github.com/Anycade/sdk/issues"},"dist":{"shasum":"8820707b4e812404b0adf002a21e907cd90c5f6b","tarball":"https://registry.npmjs.org/@anycade/sdk/-/sdk-0.0.2.tgz","fileCount":7,"integrity":"sha512-+pbS+3vtTw2g/2fNL417ANz3oXnRGzzjxp9Yu+RDKuI+WKFai4pwZ9PNbM99ckIrgwuVDlXIRQ2a4dJWwL0QWg==","signatures":[{"sig":"MEYCIQCinM8ETc5thPfHFC3qRveeHwlpyPDkdzhqBuJ2u9prXQIhAN8J1YWwsLj7yjBpUFOuH0WFBXhwl8wcpLHOWhIME5SA","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16160},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"124cecfc47a45c329f986c6f7823654a8c0e6a27","scripts":{"dev":"vite","test":"vitest","build":"tsdown","dev:build":"vite build","dev:start":"vite preview"},"_npmUser":{"name":"mvrlin","email":"mamuco@mail.ru"},"repository":{"url":"git+https://github.com/Anycade/sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Anycade SDK","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"vite":"7.2.2","eslint":"9.37.0","tsdown":"0.15.6","vitest":"3.2.4","globals":"16.4.0","prettier":"3.6.2","typescript":"5.9.3","@types/node":"24.7.1","eslint-config-prettier":"10.1.8","eslint-plugin-prettier":"5.5.4","@typescript-eslint/parser":"8.46.0","eslint-plugin-perfectionist":"4.15.1","@typescript-eslint/eslint-plugin":"8.46.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.0.2_1763749303774_0.7338364837212852","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@anycade/sdk","version":"0.0.3","keywords":["anycade","anycade games","sdk"],"license":"MIT","_id":"@anycade/sdk@0.0.3","maintainers":[{"name":"mvrlin","email":"mamuco@mail.ru"}],"homepage":"https://github.com/Anycade/sdk#readme","bugs":{"url":"https://github.com/Anycade/sdk/issues"},"dist":{"shasum":"93d981e8fa77425a9b53c5ac385d22bfa2135ff2","tarball":"https://registry.npmjs.org/@anycade/sdk/-/sdk-0.0.3.tgz","fileCount":7,"integrity":"sha512-ux2dP7Zjw8xjrWkUZj/dB1ib3essShmZm+vBLqKgujx5Pob8KBBMIDLPTmUa0703Lb0Pu2EeKYxlbK2lEkPt6g==","signatures":[{"sig":"MEYCIQD4tgywbf2AmPfSLpjyttC0i0B1kK3iKtgdQTet8olkIwIhANEkV5vkO9IN+S+vPb1onHnD1hVHT12nx3+sjLLkO1KW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15737},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"76f6898b9540e03208dde6fc98c512e11f9953e9","scripts":{"dev":"vite","test":"vitest","build":"tsdown","dev:build":"vite build","dev:start":"vite preview"},"_npmUser":{"name":"mvrlin","email":"mamuco@mail.ru"},"repository":{"url":"git+https://github.com/Anycade/sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Anycade SDK","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"vite":"7.2.2","eslint":"9.37.0","tsdown":"0.15.6","vitest":"3.2.4","globals":"16.4.0","prettier":"3.6.2","typescript":"5.9.3","@types/node":"24.7.1","eslint-config-prettier":"10.1.8","eslint-plugin-prettier":"5.5.4","@typescript-eslint/parser":"8.46.0","eslint-plugin-perfectionist":"4.15.1","@typescript-eslint/eslint-plugin":"8.46.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.0.3_1763749526558_0.6247900185633997","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@anycade/sdk","version":"1.0.0","keywords":["anycade","anycade games","sdk"],"license":"MIT","_id":"@anycade/sdk@1.0.0","maintainers":[{"name":"mvrlin","email":"mamuco@mail.ru"}],"homepage":"https://github.com/Anycade/sdk#readme","bugs":{"url":"https://github.com/Anycade/sdk/issues"},"dist":{"shasum":"dd8f1568d6ffa399c98d7de3a3f6e9e5ba47ab69","tarball":"https://registry.npmjs.org/@anycade/sdk/-/sdk-1.0.0.tgz","fileCount":7,"integrity":"sha512-jDd2Cvu+mCnxNAA7nNFcX4SfwTOlrHNario5zNjaGRokj0YRmXBJRGIzM+Uia6IsHD3O0p1fG3ebgXPdWoGDgg==","signatures":[{"sig":"MEUCIFPiyxcX2kQKsMykQGanJLfzXmCHLZ1LQDggkunMCOdNAiEAnksYFxWXRAnTxtt1ek6bdBVlWFdzgyOZ15qzYsfbmto=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17509},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"ddc98e2e42163df21cbd1b6bc0d8033e00963c81","scripts":{"dev":"vite","test":"vitest","build":"tsdown","dev:build":"vite build","dev:start":"vite preview"},"_npmUser":{"name":"mvrlin","email":"mamuco@mail.ru"},"repository":{"url":"git+https://github.com/Anycade/sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Anycade SDK","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"vite":"7.2.2","eslint":"9.37.0","tsdown":"0.15.6","vitest":"3.2.4","globals":"16.4.0","prettier":"3.6.2","typescript":"5.9.3","@types/node":"24.7.1","eslint-config-prettier":"10.1.8","eslint-plugin-prettier":"5.5.4","@typescript-eslint/parser":"8.46.0","eslint-plugin-perfectionist":"4.15.1","@typescript-eslint/eslint-plugin":"8.46.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.0_1763990428133_0.3062015181961939","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@anycade/sdk","version":"1.0.1","description":"Anycade SDK","type":"module","keywords":["anycade","anycade games","sdk"],"repository":{"type":"git","url":"git+https://github.com/Anycade/sdk.git"},"license":"MIT","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"build":"tsdown","dev":"vite","dev:build":"vite build","dev:start":"vite preview","test":"vitest"},"devDependencies":{"@types/node":"24.7.1","@typescript-eslint/eslint-plugin":"8.46.0","@typescript-eslint/parser":"8.46.0","eslint":"9.37.0","eslint-config-prettier":"10.1.8","eslint-plugin-perfectionist":"4.15.1","eslint-plugin-prettier":"5.5.4","globals":"16.4.0","prettier":"3.6.2","tsdown":"0.15.6","typescript":"5.9.3","vite":"7.2.2","vitest":"3.2.4"},"_id":"@anycade/sdk@1.0.1","gitHead":"9c5d42aec9fba58096d55c85a684b8ac41c31f6d","bugs":{"url":"https://github.com/Anycade/sdk/issues"},"homepage":"https://github.com/Anycade/sdk#readme","_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-bI0GjmNKlUALJLi6yp0xIxdNV7uoXNwdRb4alQTjc3GTjbjb1CmF2P5eoJeYokRBk1PrQ6ZVy00w81vpbrYpjQ==","shasum":"c6fb9440b7f5e418ad9c24397b47736974db3fcc","tarball":"https://registry.npmjs.org/@anycade/sdk/-/sdk-1.0.1.tgz","fileCount":7,"unpackedSize":17503,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCNoM0NwqVM2IjRBuMLbC7ccV6C3abzWMl5PFAYKTMoIgIgH7pR3DT9DKBWoWq1cdSfJFlpxVQmWRR84zp1RKVNW8w="}]},"_npmUser":{"name":"mvrlin","email":"mamuco@mail.ru"},"directories":{},"maintainers":[{"name":"mvrlin","email":"mamuco@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_1.0.1_1763990552456_0.623266105246983"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-15T15:26:57.470Z","modified":"2025-11-24T13:22:32.925Z","0.0.1":"2025-11-15T15:26:57.819Z","0.0.2":"2025-11-21T18:21:43.976Z","0.0.3":"2025-11-21T18:25:26.769Z","1.0.0":"2025-11-24T13:20:28.320Z","1.0.1":"2025-11-24T13:22:32.658Z"},"bugs":{"url":"https://github.com/Anycade/sdk/issues"},"license":"MIT","homepage":"https://github.com/Anycade/sdk#readme","keywords":["anycade","anycade games","sdk"],"repository":{"type":"git","url":"git+https://github.com/Anycade/sdk.git"},"description":"Anycade SDK","maintainers":[{"name":"mvrlin","email":"mamuco@mail.ru"}],"readme":"[![Bundle Size](https://img.shields.io/bundlephobia/min/@anycade/sdk?style=for-the-badge)](https://www.npmjs.com/package/@anycade/sdk)\n[![Version](https://img.shields.io/npm/v/@anycade/sdk/latest.svg?style=for-the-badge)](https://www.npmjs.com/package/@anycade/sdk)\n\n# @anycade/sdk\n\n> Web SDK for Anycade Games\n\n## Installation\n\n```bash\n# npm\nnpm i @anycade/sdk\n# yarn\nyarn add @anycade/sdk\n# pnpm\npnpm add @anycade/sdk\n```\n\n## Installation using CDN\n> **Warning**\\\n> The script must be inserted before your main game script!\n```html\n<script src=\"https://unpkg.com/@anycade/sdk/dist/browser/index.min.js\"></script>\n```\n\n## Getting started\n\n```typescript\nimport { SDK } from '@anycade/sdk';\n\nconst sdk = new SDK({\n  gameId: '123456'\n});\n```\n\n> Using the **CDN** version, the `SDK` class is accessible through `Anycade`.\n```javascript\nconst sdk = new Anycade.SDK({\n  gameId: '123456'\n});\n```\n\n## SDK options\n- `debug` - Debug mode\n- `gameId` - Game ID\n\n### `initialize`\nSDK initialization with the platform.\n\n```typescript\nconst sdk = new SDK({\n    gameId: '123456',\n});\n\ntry {\n    await sdk.initialize();\n    // Ok\n} catch (error) {\n    // Error\n}\n```\n\n## Payments\n\n### `purchase`\nShow the payment window.\n\n```typescript\ntry {\n    const result = await sdk.payments.purchase({\n        meta: {\n            // Custom fields to retrieve\n            foo: 'bar',\n        },\n\n        productId: '123456', // Id of the product from the platform\n    });\n\n    // Handle the result.\n    switch (result.status) {\n        case 'cancel':\n            // Cancel the payment process.\n        case 'fail':\n            // Failed to pay.\n        case 'success':\n            // Paid successfully.\n    }\n\n    // Access custom fields.\n    result.meta;\n} catch (error) {\n    // Error\n}\n```\n\n","readmeFilename":"README.md"}