{"_id":"@atmyapp/react","_rev":"8-4e4ec4f1f30802e713ab1411889ff355","name":"@atmyapp/react","dist-tags":{"latest":"1.0.7"},"versions":{"1.0.0":{"name":"@atmyapp/react","version":"1.0.0","keywords":["react","typescript","cli"],"license":"MIT","_id":"@atmyapp/react@1.0.0","maintainers":[{"name":"gamma007","email":"maciekgamro@gmail.com"}],"homepage":"https://github.com/At-My-App/react#readme","bugs":{"url":"https://github.com/At-My-App/react/issues"},"bin":{"ama":"dist/cli/index.js"},"dist":{"shasum":"aa78257a75c66a466e5cea886ff15c1bb3fa419f","tarball":"https://registry.npmjs.org/@atmyapp/react/-/react-1.0.0.tgz","fileCount":30,"integrity":"sha512-Wjc/YYZMttVnha8v/Hwxgow3BNn6ZCFuj7k8W+mgL4IMXCl8iNgUoftpZBZnvNNQWys+Bg52xTh87Ha1Fyo9Tw==","signatures":[{"sig":"MEUCIFDJZtoUgXnabDLRFfbjKAtIkEz4ZzRPQLLgofB3G5V6AiEAvueDs3NaJ4dNkZJwqz6k/HLxfJuq6yjpCgTmvhvE3g0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46857},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"c3ac5f7ff619b5e7b1b0326b63859fe13314fc57","scripts":{"test":"jest","build":"tsc","test:watch":"jest --watch","test:migrate":"node ./dist/cli/test-migrate.js"},"_npmUser":{"name":"gamma007","email":"maciekgamro@gmail.com"},"overrides":{"typescript-json-schema":{"typescript":"$typescript"}},"repository":{"url":"git+https://github.com/At-My-App/react.git","type":"git"},"_npmVersion":"10.8.2","description":"React client for At My App","directories":{},"resolutions":{"typescript":"5.3.3"},"_nodeVersion":"18.20.7","dependencies":{"zod":">=3.0.0","chalk":"^4.1.2","react":">=16.8.0","ts-morph":"^25.0.0","commander":"^9.5.0","fast-glob":"^3.3.3","typescript":"5.3.3","typescript-json-schema":"^0.65.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.6","@types/jest":"^29.5.14","@types/node":"^22.10.7","@types/react":"^18.2.0","@testing-library/jest-dom":"^6.6.3"},"peerDependencies":{"zod":">=3.0.0","react":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/react_1.0.0_1741872780009_0.43942082843402397","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@atmyapp/react","version":"1.0.1","keywords":["react","typescript","cli"],"license":"MIT","_id":"@atmyapp/react@1.0.1","maintainers":[{"name":"gamma007","email":"maciekgamro@gmail.com"}],"homepage":"https://github.com/At-My-App/react#readme","bugs":{"url":"https://github.com/At-My-App/react/issues"},"bin":{"ama":"dist/cli/index.js"},"dist":{"shasum":"8522319a0966c1fb7ea6471360f1a64da2d7d8b6","tarball":"https://registry.npmjs.org/@atmyapp/react/-/react-1.0.1.tgz","fileCount":30,"integrity":"sha512-uwuG5vx5hU/cyZsn/rVdRvBy9ivW0J+lDl+7lMKqncuqP5wolFKmU/xiKRnSXldlI1tvkvCjGBAKrEGLrlJ/4Q==","signatures":[{"sig":"MEYCIQDnn/UY2fV+sL3l5+EDU4k1uCAKLtUWMMiRz6gRnLW3gQIhAJ/YtkFKOHHnpkS7tHIQYXveCV2AN5RYprrTD4admJzV","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":50798},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"de760fd0976ec91efb7d5d3126e28487e187bab3","scripts":{"test":"jest","build":"tsc","test:watch":"jest --watch","test:migrate":"node ./dist/cli/test-migrate.js"},"_npmUser":{"name":"gamma007","email":"maciekgamro@gmail.com"},"overrides":{"typescript-json-schema":{"typescript":"$typescript"}},"repository":{"url":"git+https://github.com/At-My-App/react.git","type":"git"},"_npmVersion":"10.8.2","description":"React client for At My App","directories":{},"resolutions":{"typescript":"5.3.3"},"_nodeVersion":"18.20.7","dependencies":{"zod":">=3.0.0","chalk":"^4.1.2","react":">=16.8.0","ts-morph":"^25.0.0","commander":"^9.5.0","fast-glob":"^3.3.3","typescript":"5.3.3","typescript-json-schema":"^0.65.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.6","@types/jest":"^29.5.14","@types/node":"^22.10.7","@types/react":"^18.2.0","@testing-library/jest-dom":"^6.6.3"},"peerDependencies":{"zod":">=3.0.0","react":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/react_1.0.1_1741881792501_0.5165085548587289","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@atmyapp/react","version":"1.0.2","keywords":["react","typescript","cli"],"license":"MIT","_id":"@atmyapp/react@1.0.2","maintainers":[{"name":"gamma007","email":"maciekgamro@gmail.com"}],"homepage":"https://github.com/At-My-App/react#readme","bugs":{"url":"https://github.com/At-My-App/react/issues"},"bin":{"ama":"dist/cli/index.js"},"dist":{"shasum":"c25fb9146e36a88dbc7a74990eb03bf0172a0614","tarball":"https://registry.npmjs.org/@atmyapp/react/-/react-1.0.2.tgz","fileCount":44,"integrity":"sha512-TXVuNAl2Rv+B6cMemxlldfD54DonON+OgBXed5shBGobGwd3zcU33am9DaLg5D7rsaoxg/0SHSmXet2jmwipRw==","signatures":[{"sig":"MEUCIA8v9s0B5deZj8mO21HtMfX0NSZxC+9w8bf1s3GtCgoPAiEAwnBSCtoRGYrEX/qLZQDEOdKMZGWDiT/Ay4yvp6YAvXM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":101192},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"eced3cec5a6e325a75e7d80eb4e33d119b273e69","scripts":{"test":"jest","build":"tsc","test:watch":"jest --watch","test:migrate":"node ./dist/cli/test-migrate.js"},"_npmUser":{"name":"gamma007","email":"maciekgamro@gmail.com"},"overrides":{"typescript-json-schema":{"typescript":"$typescript"}},"repository":{"url":"git+https://github.com/At-My-App/react.git","type":"git"},"_npmVersion":"10.8.2","description":"React client for At My App","directories":{},"resolutions":{"typescript":"5.3.3"},"_nodeVersion":"18.20.7","dependencies":{"zod":">=3.0.0","chalk":"^4.1.2","react":">=16.8.0","ts-morph":"^25.0.0","commander":"^9.5.0","fast-glob":"^3.3.3","typescript":"5.3.3","typescript-json-schema":"^0.65.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.6","@types/jest":"^29.5.14","@types/node":"^22.10.7","@types/react":"^18.2.0","@testing-library/jest-dom":"^6.6.3"},"peerDependencies":{"zod":">=3.0.0","react":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/react_1.0.2_1742924178000_0.7542659961255405","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@atmyapp/react","version":"1.0.3","keywords":["react","typescript","cli"],"license":"MIT","_id":"@atmyapp/react@1.0.3","maintainers":[{"name":"gamma007","email":"maciekgamro@gmail.com"}],"homepage":"https://github.com/At-My-App/react#readme","bugs":{"url":"https://github.com/At-My-App/react/issues"},"bin":{"ama":"dist/cli/index.js"},"dist":{"shasum":"65c9fc272b195f40bded19bb7a29ab22819550fb","tarball":"https://registry.npmjs.org/@atmyapp/react/-/react-1.0.3.tgz","fileCount":44,"integrity":"sha512-As1zlYE1O5ILi8OcokuGa/KZ6S2cR/3mkSHQHZaB4g9WTJ+QR7juuj4YT9Tqs+WokIQp8xRgues7ec6ivQMD0A==","signatures":[{"sig":"MEYCIQC6VSwIn1okofY2qPGHnUUPpySXiWvn2F0AZqPqjgcEegIhAItdYbmlD1fM3GoKik43ZfECABdZVeHmOrV8TLHJyddZ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":102228},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"6842683c33726d8915ff4aaff930c9a7b9a9bb39","scripts":{"test":"jest","build":"tsc","test:watch":"jest --watch","test:migrate":"node ./dist/cli/test-migrate.js"},"_npmUser":{"name":"gamma007","email":"maciekgamro@gmail.com"},"overrides":{"typescript-json-schema":{"typescript":"$typescript"}},"repository":{"url":"git+https://github.com/At-My-App/react.git","type":"git"},"_npmVersion":"10.8.2","description":"React client for At My App","directories":{},"resolutions":{"typescript":"5.3.3"},"_nodeVersion":"18.20.7","dependencies":{"zod":">=3.0.0","chalk":"^4.1.2","react":">=16.8.0","ts-morph":"^25.0.0","commander":"^9.5.0","fast-glob":"^3.3.3","typescript":"5.3.3","typescript-json-schema":"^0.65.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.6","@types/jest":"^29.5.14","@types/node":"^22.10.7","@types/react":"^18.2.0","@testing-library/jest-dom":"^6.6.3"},"peerDependencies":{"zod":">=3.0.0","react":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/react_1.0.3_1742924496881_0.4771857487201927","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@atmyapp/react","version":"1.0.4","keywords":["react","typescript","cli"],"license":"MIT","_id":"@atmyapp/react@1.0.4","maintainers":[{"name":"gamma007","email":"maciekgamro@gmail.com"}],"homepage":"https://github.com/At-My-App/react#readme","bugs":{"url":"https://github.com/At-My-App/react/issues"},"bin":{"ama":"dist/cli/index.js"},"dist":{"shasum":"487e077cd024e0ac23a852034794782cabc85666","tarball":"https://registry.npmjs.org/@atmyapp/react/-/react-1.0.4.tgz","fileCount":46,"integrity":"sha512-1sY9utj3tvF5ZDxCBxfyMXD0/AS3l7UOQsQ2OepSxfu2HXeNzc2QvCy29HYv5vnp0NGM2+r1RgzBKLTzQOHZcg==","signatures":[{"sig":"MEQCIDQ9MRaQFD+zCZRxrAsewUpuu7NlFyHP2TNKLdGamInUAiB4J1CaTn0V6QTLXc/WlNlazb9FPYdaMfMYnuNnQGz3+g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":110444},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"ec6a735f8bb99ba30a137b9e5c5e71f6d0c1b0ee","scripts":{"test":"jest","build":"tsc","test:watch":"jest --watch","test:migrate":"node ./dist/cli/test-migrate.js"},"_npmUser":{"name":"gamma007","email":"maciekgamro@gmail.com"},"overrides":{"typescript-json-schema":{"typescript":"$typescript"}},"repository":{"url":"git+https://github.com/At-My-App/react.git","type":"git"},"_npmVersion":"10.8.2","description":"React client for At My App","directories":{},"resolutions":{"typescript":"5.3.3"},"_nodeVersion":"18.20.7","dependencies":{"zod":">=3.0.0","chalk":"^4.1.2","react":">=16.8.0","ts-morph":"^25.0.0","commander":"^9.5.0","fast-glob":"^3.3.3","typescript":"5.3.3","typescript-json-schema":"^0.65.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.6","@types/jest":"^29.5.14","@types/node":"^22.10.7","@types/react":"^18.2.0","@testing-library/jest-dom":"^6.6.3"},"peerDependencies":{"zod":">=3.0.0","react":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/react_1.0.4_1743702957157_0.2346334560025345","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@atmyapp/react","version":"1.0.5","keywords":["react","typescript","atmyapp","hooks"],"license":"MIT","_id":"@atmyapp/react@1.0.5","maintainers":[{"name":"gamma007","email":"maciekgamro@gmail.com"}],"homepage":"https://github.com/At-My-App/react#readme","bugs":{"url":"https://github.com/At-My-App/react/issues"},"dist":{"shasum":"7d0da31ac6f274f82a6e71bfd62451aa2bdc7ce2","tarball":"https://registry.npmjs.org/@atmyapp/react/-/react-1.0.5.tgz","fileCount":16,"integrity":"sha512-910PVC4TLIhTqGbl7ClaqUOt9V2/rRuF57ORtZzuoMySOHaklYAI34S4us3u79i8MRYeWZXoGCxjP8VYpzbnqA==","signatures":[{"sig":"MEUCICpJUxJipkJoQ/n6SVnvD9hRnkDDLUkAWS0FpYWohQdkAiEA/pcBB0UK2KVHnudjzkwutZjypwJ1p/63yUjLnlLbRDQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31521},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"9d154fe35fa4d87d2c2f04a3f65be22f559df299","scripts":{"test":"jest","build":"tsc","test:watch":"jest --watch"},"_npmUser":{"name":"gamma007","email":"maciekgamro@gmail.com"},"repository":{"url":"git+https://github.com/At-My-App/react.git","type":"git"},"_npmVersion":"10.8.2","description":"React client for At My App","directories":{},"_nodeVersion":"18.20.8","dependencies":{"@atmyapp/core":"0.0.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.6","typescript":"^5.3.3","@types/jest":"^29.5.14","@types/node":"^22.10.7","@types/react":"^19.1.6","@testing-library/react":"^16.3.0","jest-environment-jsdom":"^29.7.0","@testing-library/jest-dom":"^6.6.3"},"peerDependencies":{"react":"^19.1.0"},"_npmOperationalInternal":{"tmp":"tmp/react_1.0.5_1748959908366_0.9614011810770071","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@atmyapp/react","version":"1.0.6","keywords":["react","typescript","atmyapp","hooks"],"license":"MIT","_id":"@atmyapp/react@1.0.6","maintainers":[{"name":"gamma007","email":"maciekgamro@gmail.com"}],"homepage":"https://github.com/At-My-App/react#readme","bugs":{"url":"https://github.com/At-My-App/react/issues"},"dist":{"shasum":"a9250e8b38d7c89d05071cde542930642fd6d14a","tarball":"https://registry.npmjs.org/@atmyapp/react/-/react-1.0.6.tgz","fileCount":16,"integrity":"sha512-mDRH7VBBPkLzbEFwf21L2PK3Sp0EPo2F8keFWenUpLaQL/GVeCtOs+ls+CKxdMjFh0G9emQWr5gPRPh2XJIUCw==","signatures":[{"sig":"MEUCIAhAbbHaGBrpNPLzKI56ijsNPYpsQunZztfBdxBMrApcAiEA6PuktGi/+BLeJqXJmzScunrkBXYsY7AE8DMKdjMd+Nw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31706},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"c2627a47410e51da20beb567f30801e4bbf5a377","scripts":{"test":"jest","build":"tsc","test:watch":"jest --watch"},"_npmUser":{"name":"gamma007","email":"maciekgamro@gmail.com"},"repository":{"url":"git+https://github.com/At-My-App/react.git","type":"git"},"_npmVersion":"10.8.2","description":"React client for At My App","directories":{},"_nodeVersion":"18.20.8","dependencies":{"@atmyapp/core":"0.0.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","react":"^19.1.0","ts-jest":"^29.2.6","react-dom":"^19.1.0","typescript":"^5.3.3","@types/jest":"^29.5.14","@types/node":"^22.10.7","@types/react":"^19.1.6","@testing-library/dom":"^10.4.0","@testing-library/react":"^16.1.0","jest-environment-jsdom":"^29.7.0","@testing-library/jest-dom":"^6.6.3"},"peerDependencies":{"react":"^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0","react-dom":"^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react_1.0.6_1748960882730_0.9932219691022282","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"@atmyapp/react","description":"React client for At My App","license":"MIT","version":"1.0.7","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/At-My-App/react.git"},"keywords":["react","typescript","atmyapp","hooks"],"publishConfig":{"access":"public"},"scripts":{"build":"tsc","test":"jest","test:watch":"jest --watch"},"dependencies":{"@atmyapp/core":"^0.0.6"},"devDependencies":{"@testing-library/dom":"^10.4.0","@testing-library/jest-dom":"^6.6.3","@testing-library/react":"^16.1.0","@types/jest":"^29.5.14","@types/node":"^22.10.7","@types/react":"^19.1.6","jest":"^29.7.0","jest-environment-jsdom":"^29.7.0","react":"^19.1.0","react-dom":"^19.1.0","ts-jest":"^29.2.6","typescript":"^5.3.3"},"peerDependencies":{"react":"^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0","react-dom":"^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"},"_id":"@atmyapp/react@1.0.7","gitHead":"330ca08519b3dc64eb7c9be3b49deffa55ddda31","bugs":{"url":"https://github.com/At-My-App/react/issues"},"homepage":"https://github.com/At-My-App/react#readme","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"integrity":"sha512-oASw6eRMHY6vVhGUMTjXmg7x/opeygntcrEd2K6n+r3C5v5FFdatgg/ImOeKvHW7PnnUficdPqeGIq8LpeG3mA==","shasum":"69ca938f633c71f28a9ffe0bb3be6ca249808846","tarball":"https://registry.npmjs.org/@atmyapp/react/-/react-1.0.7.tgz","fileCount":20,"unpackedSize":48224,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCdFPH9uSH8mzF4wGcFnc/yZtlv8BV+HtJYqgzKIxx+NgIhAM9OQzzKciHzXnewC9nu35S6CQh7yNwtTLb2iJA68E4a"}]},"_npmUser":{"name":"gamma007","email":"maciekgamro@gmail.com","actor":{"name":"gamma007","email":"maciekgamro@gmail.com","type":"user"}},"directories":{},"maintainers":[{"name":"gamma007","email":"maciekgamro@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react_1.0.7_1750348317738_0.4846076368073988"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-13T13:32:59.867Z","modified":"2025-06-19T15:51:58.165Z","1.0.0":"2025-03-13T13:33:00.193Z","1.0.1":"2025-03-13T16:03:12.686Z","1.0.2":"2025-03-25T17:36:18.221Z","1.0.3":"2025-03-25T17:41:37.092Z","1.0.4":"2025-04-03T17:55:57.341Z","1.0.5":"2025-06-03T14:11:48.551Z","1.0.6":"2025-06-03T14:28:02.920Z","1.0.7":"2025-06-19T15:51:57.912Z"},"bugs":{"url":"https://github.com/At-My-App/react/issues"},"license":"MIT","homepage":"https://github.com/At-My-App/react#readme","keywords":["react","typescript","atmyapp","hooks"],"repository":{"type":"git","url":"git+https://github.com/At-My-App/react.git"},"description":"React client for At My App","maintainers":[{"name":"gamma007","email":"maciekgamro@gmail.com"}],"readme":"# 🚀 AtMyApp React\n\n[![npm version](https://badge.fury.io/js/%40atmyapp%2Freact.svg)](https://badge.fury.io/js/%40atmyapp%2Freact)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)\n\n> 🎯 **React hooks for AtMyApp.** The official React library for AtMyApp - AI-powered content management with type-safe hooks.\n\n## 📖 Table of Contents\n\n- [🌟 Features](#-features)\n- [📦 Installation](#-installation)\n- [🚀 Quick Start](#-quick-start)\n- [📚 API Reference](#-api-reference)\n  - [Provider Setup](#provider-setup)\n  - [Content Hooks](#content-hooks)\n  - [Analytics Hooks](#analytics-hooks)\n- [🧪 Testing](#-testing)\n- [💡 Examples](#-examples)\n- [🤝 Contributing](#-contributing)\n- [📄 License](#-license)\n\n## 🌟 Features\n\n✨ **Type-Safe Hooks** - React hooks with full TypeScript support  \n🔄 **Real-time Content** - Fetch content, images, and files from AtMyApp  \n📊 **Built-in Analytics** - Track events with React hooks  \n⚡ **Core Library Integration** - Built on @atmyapp/core for consistency  \n🎯 **Auto-Caching** - Intelligent caching for optimal performance  \n🚀 **Zero Configuration** - Works out of the box with minimal setup\n\n## 📦 Installation\n\n```bash\n# npm\nnpm install @atmyapp/react @atmyapp/core\n\n# yarn\nyarn add @atmyapp/react @atmyapp/core\n\n# pnpm\npnpm add @atmyapp/react @atmyapp/core\n```\n\n## 🚀 Quick Start\n\n### Option 1: Using Provider (Recommended)\n\n```tsx\nimport React from \"react\";\nimport { AmaProvider, useAmaContent } from \"@atmyapp/react\";\n\n// Wrap your app with the provider\nfunction App() {\n  return (\n    <AmaProvider\n      apiKey=\"your-api-key\"\n      baseUrl=\"https://api.atmyapp.com\"\n      previewKey=\"optional-preview-key\"\n    >\n      <BlogPost />\n    </AmaProvider>\n  );\n}\n\n// Use hooks in your components\nfunction BlogPost() {\n  const { data, isLoading, error } = useAmaContent(\"/blog/latest\");\n\n  if (isLoading) return <div>Loading...</div>;\n  if (error) return <div>Error: {error.message}</div>;\n\n  return (\n    <article>\n      <h1>{data.title}</h1>\n      <p>{data.content}</p>\n    </article>\n  );\n}\n```\n\n### Option 2: Using Client Instance\n\n```tsx\nimport React from \"react\";\nimport { createAtMyApp, useAmaContent } from \"@atmyapp/react\";\n\n// Create a client instance\nconst amaClient = createAtMyApp({\n  apiKey: \"your-api-key\",\n  baseUrl: \"https://api.atmyapp.com\",\n});\n\nfunction BlogPost() {\n  const { data, isLoading, error } = useAmaContent(\"/blog/latest\", amaClient);\n\n  if (isLoading) return <div>Loading...</div>;\n  if (error) return <div>Error: {error.message}</div>;\n\n  return (\n    <article>\n      <h1>{data.title}</h1>\n      <p>{data.content}</p>\n    </article>\n  );\n}\n```\n\n## 📚 API Reference\n\n### Provider Setup\n\n#### `AmaProvider`\n\nProvides AtMyApp client context to child components.\n\n```tsx\n<AmaProvider\n  apiKey=\"your-api-key\"\n  baseUrl=\"https://api.atmyapp.com\"\n  previewKey=\"optional-preview-key\" // For draft content\n>\n  {children}\n</AmaProvider>\n```\n\n#### `createAtMyApp(config)`\n\nCreates a client instance for use without provider.\n\n```tsx\nconst client = createAtMyApp({\n  apiKey: \"your-api-key\",\n  baseUrl: \"https://api.atmyapp.com\",\n  previewKey: \"optional-preview-key\",\n});\n```\n\n### Content Hooks\n\n#### `useAmaContent<T>(path, client?)`\n\nFetch typed content from AtMyApp.\n\n```tsx\nimport { useAmaContent, AmaContentDef } from \"@atmyapp/react\";\n\n// Define your content type\ntype BlogPost = AmaContentDef<\n  \"/blog/post\",\n  {\n    title: string;\n    content: string;\n    publishedAt: string;\n  }\n>;\n\nfunction BlogComponent() {\n  const { data, isLoading, error } = useAmaContent<BlogPost>(\"/blog/post\");\n\n  // data is typed as { title: string; content: string; publishedAt: string; }\n}\n```\n\n#### `useAmaImage<T>(path, client?)`\n\nFetch optimized images from AtMyApp.\n\n```tsx\nimport { useAmaImage, AmaImageDef } from \"@atmyapp/react\";\n\n// Define your image type\ntype HeroImage = AmaImageDef<\n  \"/images/hero\",\n  {\n    optimizeFormat: \"webp\";\n    maxSize: { width: 1920; height: 1080 };\n  }\n>;\n\nfunction HeroComponent() {\n  const { src, isLoading, error } = useAmaImage<HeroImage>(\"/images/hero\");\n\n  if (isLoading) return <div>Loading image...</div>;\n  if (error) return <div>Failed to load image</div>;\n\n  return <img src={src} alt=\"Hero\" />;\n}\n```\n\n#### `useAmaFile<T>(path, client?)`\n\nFetch files from AtMyApp.\n\n```tsx\nimport { useAmaFile, AmaFileDef } from \"@atmyapp/react\";\n\ntype DocumentFile = AmaFileDef<\n  \"/docs/manual.pdf\",\n  {\n    contentType: \"application/pdf\";\n  }\n>;\n\nfunction DocumentComponent() {\n  const { src, isLoading, error } =\n    useAmaFile<DocumentFile>(\"/docs/manual.pdf\");\n\n  if (isLoading) return <div>Loading document...</div>;\n  if (error) return <div>Failed to load document</div>;\n\n  return (\n    <a href={src} target=\"_blank\">\n      Download Manual\n    </a>\n  );\n}\n```\n\n### Analytics Hooks\n\n#### `useAmaAnalytics(client?)`\n\nAccess analytics functionality for tracking events.\n\n```tsx\nimport { useAmaAnalytics } from \"@atmyapp/react\";\n\nfunction ProductPage() {\n  const analytics = useAmaAnalytics();\n\n  const handleAddToCart = async () => {\n    // Track basic event (server collects metadata automatically)\n    await analytics.trackBasicEvent(\"add_to_cart\");\n\n    // Track custom event with data\n    await analytics.trackEvent(\"purchase\", {\n      product_id: \"prod_123\",\n      amount: \"99.99\",\n      currency: \"USD\",\n      user_id: \"user_456\",\n    });\n  };\n\n  return <button onClick={handleAddToCart}>Add to Cart</button>;\n}\n```\n\n## 🧪 Testing\n\nThe library includes comprehensive test coverage for all hooks and components. Tests are written using Jest and React Testing Library.\n\n### Running Tests\n\n```bash\n# Run all tests\nnpm test\n\n# Run tests in watch mode\nnpm run test:watch\n\n# Run tests with coverage\nnpm test -- --coverage\n```\n\n### Writing Tests\n\nWhen testing components that use AtMyApp hooks, wrap them in the `AmaProvider`:\n\n```tsx\nimport { render } from \"@testing-library/react\";\nimport { AmaProvider } from \"@atmyapp/react\";\n\nfunction TestWrapper({ children }: { children: React.ReactNode }) {\n  return (\n    <AmaProvider apiKey=\"test-key\" baseUrl=\"https://test.atmyapp.com\">\n      {children}\n    </AmaProvider>\n  );\n}\n\ntest(\"my component\", () => {\n  render(\n    <TestWrapper>\n      <MyComponent />\n    </TestWrapper>\n  );\n\n  // Your test assertions...\n});\n```\n\nAlternatively, provide a client instance directly:\n\n```tsx\nimport { createAtMyApp } from \"@atmyapp/react\";\n\nconst testClient = createAtMyApp({\n  apiKey: \"test-key\",\n  baseUrl: \"https://test.atmyapp.com\",\n});\n\nfunction MyComponent() {\n  const { data } = useAmaContent(\"/test/path\", testClient);\n  // Component logic...\n}\n```\n\n### Mocking AtMyApp\n\nFor unit tests, you may want to mock the core library:\n\n```tsx\njest.mock(\"@atmyapp/core\", () => ({\n  createAtMyAppClient: jest.fn(() => ({\n    collections: {\n      get: jest.fn().mockResolvedValue({\n        isError: false,\n        data: { title: \"Mock Content\" },\n      }),\n    },\n    analytics: {\n      trackBasicEvent: jest.fn().mockResolvedValue(true),\n      trackEvent: jest.fn().mockResolvedValue(true),\n    },\n  })),\n}));\n```\n\n## 💡 Examples\n\n### E-commerce Product Catalog\n\n```tsx\nimport React from \"react\";\nimport {\n  AmaProvider,\n  useAmaContent,\n  useAmaImage,\n  useAmaAnalytics,\n  AmaContentDef,\n  AmaImageDef,\n} from \"@atmyapp/react\";\n\n// Define types\ntype Product = {\n  id: string;\n  name: string;\n  price: number;\n  description: string;\n};\n\ntype ProductCatalog = AmaContentDef<\"/products/catalog\", Product[]>;\ntype ProductImage = AmaImageDef<\n  \"/images/products\",\n  {\n    optimizeFormat: \"webp\";\n    maxSize: { width: 400; height: 400 };\n  }\n>;\n\nfunction ProductList() {\n  const { data: products, isLoading } =\n    useAmaContent<ProductCatalog>(\"/products/catalog\");\n  const analytics = useAmaAnalytics();\n\n  const handleProductView = async (productId: string) => {\n    await analytics.trackBasicEvent(\"product_view\");\n    await analytics.trackEvent(\"product_interaction\", {\n      product_id: productId,\n      action: \"view\",\n      timestamp: new Date().toISOString(),\n    });\n  };\n\n  if (isLoading) return <div>Loading products...</div>;\n\n  return (\n    <div className=\"product-grid\">\n      {products?.map((product) => (\n        <ProductCard\n          key={product.id}\n          product={product}\n          onView={() => handleProductView(product.id)}\n        />\n      ))}\n    </div>\n  );\n}\n\nfunction ProductCard({\n  product,\n  onView,\n}: {\n  product: Product;\n  onView: () => void;\n}) {\n  const { src: imageSrc } = useAmaImage<ProductImage>(\n    `/images/products/${product.id}`\n  );\n\n  return (\n    <div className=\"product-card\" onClick={onView}>\n      <img src={imageSrc} alt={product.name} />\n      <h3>{product.name}</h3>\n      <p>${product.price}</p>\n      <p>{product.description}</p>\n    </div>\n  );\n}\n\nfunction App() {\n  return (\n    <AmaProvider\n      apiKey={process.env.REACT_APP_ATMYAPP_API_KEY!}\n      baseUrl={process.env.REACT_APP_ATMYAPP_BASE_URL!}\n    >\n      <ProductList />\n    </AmaProvider>\n  );\n}\n```\n\n### Blog with Analytics\n\n```tsx\nimport React, { useEffect } from \"react\";\nimport { useAmaContent, useAmaAnalytics, AmaContentDef } from \"@atmyapp/react\";\n\ntype BlogPost = AmaContentDef<\n  \"/blog/posts\",\n  {\n    title: string;\n    content: string;\n    author: string;\n    publishedAt: string;\n    tags: string[];\n  }\n>;\n\nfunction BlogPostPage({ slug }: { slug: string }) {\n  const {\n    data: post,\n    isLoading,\n    error,\n  } = useAmaContent<BlogPost>(`/blog/posts/${slug}`);\n  const analytics = useAmaAnalytics();\n\n  // Track page view when component mounts\n  useEffect(() => {\n    analytics.trackBasicEvent(\"page_view\");\n    analytics.trackEvent(\"content_view\", {\n      content_type: \"blog_post\",\n      content_id: slug,\n      timestamp: new Date().toISOString(),\n    });\n  }, [slug, analytics]);\n\n  const handleShare = async (platform: string) => {\n    await analytics.trackBasicEvent(\"content_share\");\n    await analytics.trackEvent(\"social_share\", {\n      content_id: slug,\n      platform,\n      content_type: \"blog_post\",\n    });\n  };\n\n  if (isLoading) return <div>Loading post...</div>;\n  if (error) return <div>Post not found</div>;\n  if (!post) return <div>No post data</div>;\n\n  return (\n    <article>\n      <header>\n        <h1>{post.title}</h1>\n        <p>\n          By {post.author} on {post.publishedAt}\n        </p>\n        <div className=\"tags\">\n          {post.tags.map((tag) => (\n            <span key={tag} className=\"tag\">\n              {tag}\n            </span>\n          ))}\n        </div>\n      </header>\n\n      <div className=\"content\">{post.content}</div>\n\n      <footer>\n        <button onClick={() => handleShare(\"twitter\")}>Share on Twitter</button>\n        <button onClick={() => handleShare(\"facebook\")}>\n          Share on Facebook\n        </button>\n      </footer>\n    </article>\n  );\n}\n```\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n<div align=\"center\">\n\n**[🌐 AtMyApp Website](https://atmyapp.com)** • **[📚 Documentation](https://docs.atmyapp.com)** • **[💬 Support](https://atmyapp.com/support)**\n\nMade with ❤️ by the AtMyApp team\n\n_Build React apps with AtMyApp._\n\n</div>\n","readmeFilename":"README.md"}