{"_id":"@amboras-dev/meta-shops-checkout","name":"@amboras-dev/meta-shops-checkout","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@amboras-dev/meta-shops-checkout","version":"0.2.0","description":"Meta Shops 'checkout on another website' handoff for Amboras storefronts — builds a fresh cart (line items + discount) from the deep-link URL params and activates it for checkout","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"peerDependencies":{"react":">=18","@tanstack/react-query":">=5"},"devDependencies":{"tsup":"^8.0.0","typescript":"^5.0.0","@tanstack/react-query":"^5.0.0","react":"^19.0.0","@types/react":"^19.0.0","@types/node":"^20.0.0"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","typecheck":"tsc --noEmit"},"_id":"@amboras-dev/meta-shops-checkout@0.2.0","_integrity":"sha512-JXVAKvotNnkl14k0164AMvVx1qL9NSz9Xdxb1513ntz4z2+btKRtDodxzK36Q1gvlQ/ygisd05bUghseM0RBYg==","_resolved":"/tmp/32ce86922695b5ea5c478b3144c9f65e/amboras-dev-meta-shops-checkout-0.2.0.tgz","_from":"file:amboras-dev-meta-shops-checkout-0.2.0.tgz","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-JXVAKvotNnkl14k0164AMvVx1qL9NSz9Xdxb1513ntz4z2+btKRtDodxzK36Q1gvlQ/ygisd05bUghseM0RBYg==","shasum":"b40ce4da0018d039c76f8861e045f7078e12b234","tarball":"https://registry.npmjs.org/@amboras-dev/meta-shops-checkout/-/meta-shops-checkout-0.2.0.tgz","fileCount":8,"unpackedSize":47571,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDHKD+bLjxJiz9MXahlouSAwcE8a6N88OjqhDMbHRY+ogIhAN5xTifl6WEvu0EeUA9xmQzNx2i702ksABGY5PShVDUg"}]},"_npmUser":{"name":"syazah","email":"thesyazah@gmail.com"},"directories":{},"maintainers":[{"name":"amboras-vaibhav","email":"vaibhav@amboras.com"},{"name":"azaanatamboras","email":"azaan@amboras.com"},{"name":"syazah","email":"thesyazah@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/meta-shops-checkout_0.2.0_1781080933439_0.28372034513125355"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-10T08:42:13.224Z","0.2.0":"2026-06-10T08:42:13.611Z","modified":"2026-06-10T08:42:13.938Z"},"maintainers":[{"name":"amboras-vaibhav","email":"vaibhav@amboras.com"},{"name":"azaanatamboras","email":"azaan@amboras.com"},{"name":"syazah","email":"thesyazah@gmail.com"}],"description":"Meta Shops 'checkout on another website' handoff for Amboras storefronts — builds a fresh cart (line items + discount) from the deep-link URL params and activates it for checkout","readme":"# @amboras-dev/meta-shops-checkout\n\nStorefront half of the **Facebook & Instagram Shop** plugin (`facebook-instagram-shop`).\n\nWhen a shopper checks out from a Meta Shop configured with **\"Checkout on another\nwebsite\"**, Meta sends them to a deep-link on the merchant's storefront:\n\n```\nhttps://store.example.com/checkout?products=variant_x:4,variant_y:2&coupon=SAVE10&cart_origin=meta_shops\n```\n\nThis package exports a single `rootProviders` slot component,\n`MetaShopsCheckoutProvider`, that:\n\n1. Detects the deep-link (only on the checkout path, only when\n   `cart_origin=meta_shops`).\n2. Builds a **fresh cart** with exactly the items Meta sent (`variantId:qty`).\n   The retailer_id Meta returns is the Medusa variant id, so it maps straight to\n   `createLineItem`.\n3. Applies the `coupon` as a cart promotion (a bad coupon is skipped, not fatal).\n4. Makes it the storefront's active cart (`localStorage.medusa_cart_id` +\n   invalidates the shared `['cart']` query) and strips the URL params.\n\nIt is **idempotency-guarded** (a refresh won't re-add items) and fully inert on\nevery other page/URL.\n\n### What it does NOT do\n\nPayment-session initialization is left to the storefront's `useCheckout`, which\nauto-initializes it once the shopper provides a shipping address + method —\nMedusa ties the payment amount to shipping, and Meta does not send an address,\nso payment cannot (and should not) be pre-initialized.\n\n### Installation\n\nInstalled automatically by the Amboras plugin pipeline as part of the\n`facebook-instagram-shop` plugin (it is the manifest's `npm_package`). It is a\nClass A integration — declarative `rootProviders` binding, no storefront source\nedits.\n","readmeFilename":"README.md","_rev":"1-223fc0449655de8e04a3c1e8593479e3"}