[{"data":1,"prerenderedAt":1789},["ShallowReactive",2],{"navigation_docs":3,"-docs-storefront-sdk-nextjs-overview":357,"-docs-storefront-sdk-nextjs-overview-surround":1784,"docs-site-config":1774},[4,74,135,139,161,195,273],{"title":5,"path":6,"stem":7,"children":8},"Assets API","\u002Fdocs\u002Fassets","docs\u002Fassets\u002Findex",[9,10,32,57],{"title":5,"path":6,"stem":7},{"title":11,"path":12,"stem":13,"children":14,"page":31},"Getting Started","\u002Fdocs\u002Fassets\u002Fgetting-started","docs\u002Fassets\u002F1.getting-started",[15,19,23,27],{"title":16,"path":17,"stem":18},"Base URL","\u002Fdocs\u002Fassets\u002Fgetting-started\u002Fbase-url","docs\u002Fassets\u002F1.getting-started\u002F1.base-url",{"title":20,"path":21,"stem":22},"Important Notes","\u002Fdocs\u002Fassets\u002Fgetting-started\u002Fimportant-notes","docs\u002Fassets\u002F1.getting-started\u002F2.important-notes",{"title":24,"path":25,"stem":26},"URL Format","\u002Fdocs\u002Fassets\u002Fgetting-started\u002Furl-format","docs\u002Fassets\u002F1.getting-started\u002F3.url-format",{"title":28,"path":29,"stem":30},"Custom Domains","\u002Fdocs\u002Fassets\u002Fgetting-started\u002Fcustom-domains","docs\u002Fassets\u002F1.getting-started\u002F4.custom-domains",false,{"title":33,"path":34,"stem":35,"children":36,"page":31},"Usage","\u002Fdocs\u002Fassets\u002Fusage","docs\u002Fassets\u002F2.usage",[37,41,45,49,53],{"title":38,"path":39,"stem":40},"Transforms","\u002Fdocs\u002Fassets\u002Fusage\u002Ftransforms","docs\u002Fassets\u002F2.usage\u002F1.transforms",{"title":42,"path":43,"stem":44},"Caching","\u002Fdocs\u002Fassets\u002Fusage\u002Fcaching","docs\u002Fassets\u002F2.usage\u002F2.caching",{"title":46,"path":47,"stem":48},"Recipes","\u002Fdocs\u002Fassets\u002Fusage\u002Frecipes","docs\u002Fassets\u002F2.usage\u002F3.recipes",{"title":50,"path":51,"stem":52},"Best Practices","\u002Fdocs\u002Fassets\u002Fusage\u002Fbest-practices","docs\u002Fassets\u002F2.usage\u002F4.best-practices",{"title":54,"path":55,"stem":56},"Reference","\u002Fdocs\u002Fassets\u002Fusage\u002Freference","docs\u002Fassets\u002F2.usage\u002F5.reference",{"title":58,"path":59,"stem":60,"children":61,"page":31},"Integration","\u002Fdocs\u002Fassets\u002Fintegration","docs\u002Fassets\u002F3.integration",[62,66,70],{"title":63,"path":64,"stem":65},"Nuxt","\u002Fdocs\u002Fassets\u002Fintegration\u002Fnuxt","docs\u002Fassets\u002F3.integration\u002F1.nuxt",{"title":67,"path":68,"stem":69},"Next.js","\u002Fdocs\u002Fassets\u002Fintegration\u002Fnextjs","docs\u002Fassets\u002F3.integration\u002F2.nextjs",{"title":71,"path":72,"stem":73},"Plain HTML","\u002Fdocs\u002Fassets\u002Fintegration\u002Fhtml","docs\u002Fassets\u002F3.integration\u002F3.html",{"title":75,"path":76,"stem":77,"children":78},"Avvyr CMS","\u002Fdocs\u002Fcms","docs\u002Fcms\u002Findex",[79,80,92,105,118,131],{"title":75,"path":76,"stem":77},{"title":11,"path":81,"stem":82,"children":83,"page":31},"\u002Fdocs\u002Fcms\u002Fgetting-started","docs\u002Fcms\u002F1.getting-started",[84,88],{"title":85,"path":86,"stem":87},"Quickstart","\u002Fdocs\u002Fcms\u002Fgetting-started\u002Fquickstart","docs\u002Fcms\u002F1.getting-started\u002F1.quickstart",{"title":89,"path":90,"stem":91},"Keys and access","\u002Fdocs\u002Fcms\u002Fgetting-started\u002Fkeys-and-access","docs\u002Fcms\u002F1.getting-started\u002F2.keys-and-access",{"title":93,"path":94,"stem":95,"children":96,"page":31},"Content Model","\u002Fdocs\u002Fcms\u002Fcontent-model","docs\u002Fcms\u002F2.content-model",[97,101],{"title":98,"path":99,"stem":100},"Types and fields","\u002Fdocs\u002Fcms\u002Fcontent-model\u002Ftypes-and-fields","docs\u002Fcms\u002F2.content-model\u002F1.types-and-fields",{"title":102,"path":103,"stem":104},"Entries and publishing","\u002Fdocs\u002Fcms\u002Fcontent-model\u002Fentries-and-publishing","docs\u002Fcms\u002F2.content-model\u002F2.entries-and-publishing",{"title":106,"path":107,"stem":108,"children":109,"page":31},"Delivery","\u002Fdocs\u002Fcms\u002Fdelivery","docs\u002Fcms\u002F3.delivery",[110,114],{"title":111,"path":112,"stem":113},"Delivery API","\u002Fdocs\u002Fcms\u002Fdelivery\u002Fdelivery-api","docs\u002Fcms\u002F3.delivery\u002F1.delivery-api",{"title":115,"path":116,"stem":117},"Preview and live editing","\u002Fdocs\u002Fcms\u002Fdelivery\u002Fpreview","docs\u002Fcms\u002F3.delivery\u002F2.preview",{"title":119,"path":120,"stem":121,"children":122,"page":31},"Frameworks","\u002Fdocs\u002Fcms\u002Fframeworks","docs\u002Fcms\u002F4.frameworks",[123,127],{"title":124,"path":125,"stem":126},"JavaScript client","\u002Fdocs\u002Fcms\u002Fframeworks\u002Fjavascript-client","docs\u002Fcms\u002F4.frameworks\u002F1.javascript-client",{"title":128,"path":129,"stem":130},"Nuxt layer","\u002Fdocs\u002Fcms\u002Fframeworks\u002Fnuxt","docs\u002Fcms\u002F4.frameworks\u002F2.nuxt",{"title":132,"path":133,"stem":134},"Management API","\u002Fdocs\u002Fcms\u002Fmanagement-api","docs\u002Fcms\u002F5.management-api",{"title":136,"path":137,"stem":138},"Early Access","\u002Fdocs\u002Fearly-access","docs\u002Fearly-access",{"title":140,"path":141,"stem":142,"children":143},"Events API","\u002Fdocs\u002Fevents","docs\u002Fevents\u002Findex",[144,145],{"title":140,"path":141,"stem":142},{"title":11,"path":146,"stem":147,"children":148,"page":31},"\u002Fdocs\u002Fevents\u002Fgetting-started","docs\u002Fevents\u002F1.getting-started",[149,153,157],{"title":150,"path":151,"stem":152},"Subscribing","\u002Fdocs\u002Fevents\u002Fgetting-started\u002Fsubscribing","docs\u002Fevents\u002F1.getting-started\u002F1.subscribing",{"title":154,"path":155,"stem":156},"Event Delivery","\u002Fdocs\u002Fevents\u002Fgetting-started\u002Fevent-delivery","docs\u002Fevents\u002F1.getting-started\u002F2.event-delivery",{"title":158,"path":159,"stem":160},"Event Reference","\u002Fdocs\u002Fevents\u002Fgetting-started\u002Fevent-reference","docs\u002Fevents\u002F1.getting-started\u002F3.event-reference",{"title":162,"path":163,"stem":164,"children":165},"Integrations API","\u002Fdocs\u002Fintegrations","docs\u002Fintegrations\u002Findex",[166,167],{"title":162,"path":163,"stem":164},{"title":11,"path":168,"stem":169,"children":170,"page":31},"\u002Fdocs\u002Fintegrations\u002Fgetting-started","docs\u002Fintegrations\u002F1.getting-started",[171,175,179,183,187,191],{"title":172,"path":173,"stem":174},"Why Use It?","\u002Fdocs\u002Fintegrations\u002Fgetting-started\u002Fwhy-integrations-api","docs\u002Fintegrations\u002F1.getting-started\u002F1.why-integrations-api",{"title":176,"path":177,"stem":178},"Use Cases","\u002Fdocs\u002Fintegrations\u002Fgetting-started\u002Fwho-is-it-for","docs\u002Fintegrations\u002F1.getting-started\u002F2.who-is-it-for",{"title":180,"path":181,"stem":182},"Pre-built Connectors","\u002Fdocs\u002Fintegrations\u002Fgetting-started\u002Fpre-built-integrations","docs\u002Fintegrations\u002F1.getting-started\u002F3.pre-built-integrations",{"title":184,"path":185,"stem":186},"Custom Inbound","\u002Fdocs\u002Fintegrations\u002Fgetting-started\u002Fcustom-inbound-api","docs\u002Fintegrations\u002F1.getting-started\u002F4.custom-inbound-api",{"title":188,"path":189,"stem":190},"Event Lifecycle","\u002Fdocs\u002Fintegrations\u002Fgetting-started\u002Fevent-lifecycle","docs\u002Fintegrations\u002F1.getting-started\u002F5.event-lifecycle",{"title":192,"path":193,"stem":194},"API Endpoints","\u002Fdocs\u002Fintegrations\u002Fgetting-started\u002Fmanagement-api-endpoints","docs\u002Fintegrations\u002F1.getting-started\u002F6.management-api-endpoints",{"title":196,"path":197,"stem":198,"children":199},"MCP Server","\u002Fdocs\u002Fmcp","docs\u002Fmcp\u002Findex",[200,201,225,234,244],{"title":196,"path":197,"stem":198},{"title":11,"path":202,"stem":203,"children":204,"page":31},"\u002Fdocs\u002Fmcp\u002Fgetting-started","docs\u002Fmcp\u002F1.getting-started",[205,209,213,217,221],{"title":206,"path":207,"stem":208},"Claude","\u002Fdocs\u002Fmcp\u002Fgetting-started\u002Fclaude","docs\u002Fmcp\u002F1.getting-started\u002F1.claude",{"title":210,"path":211,"stem":212},"Claude Code","\u002Fdocs\u002Fmcp\u002Fgetting-started\u002Fclaude-code","docs\u002Fmcp\u002F1.getting-started\u002F2.claude-code",{"title":214,"path":215,"stem":216},"VS Code","\u002Fdocs\u002Fmcp\u002Fgetting-started\u002Fvscode","docs\u002Fmcp\u002F1.getting-started\u002F3.vscode",{"title":218,"path":219,"stem":220},"Cursor","\u002Fdocs\u002Fmcp\u002Fgetting-started\u002Fcursor","docs\u002Fmcp\u002F1.getting-started\u002F4.cursor",{"title":222,"path":223,"stem":224},"Verify the connection","\u002Fdocs\u002Fmcp\u002Fgetting-started\u002Fverify","docs\u002Fmcp\u002F1.getting-started\u002F5.verify",{"title":226,"path":227,"stem":228,"children":229,"page":31},"Docs Server","\u002Fdocs\u002Fmcp\u002Fdocs-server","docs\u002Fmcp\u002F2.docs-server",[230],{"title":231,"path":232,"stem":233},"Docs server tools","\u002Fdocs\u002Fmcp\u002Fdocs-server\u002Ftools","docs\u002Fmcp\u002F2.docs-server\u002F1.tools",{"title":235,"path":236,"stem":237,"children":238},"API Server","\u002Fdocs\u002Fmcp\u002Fapi-server","docs\u002Fmcp\u002F3.api-server\u002Findex",[239,240],{"title":235,"path":236,"stem":237},{"title":241,"path":242,"stem":243},"Available tools","\u002Fdocs\u002Fmcp\u002Fapi-server\u002Ftools","docs\u002Fmcp\u002F3.api-server\u002F1.tools",{"title":245,"path":246,"stem":247,"children":248,"page":31},"Examples","\u002Fdocs\u002Fmcp\u002Fexamples","docs\u002Fmcp\u002F4.examples",[249,253,257,261,265,269],{"title":250,"path":251,"stem":252},"Exploring an API","\u002Fdocs\u002Fmcp\u002Fexamples\u002Fexploring-an-api","docs\u002Fmcp\u002F4.examples\u002F1.exploring-an-api",{"title":254,"path":255,"stem":256},"Building a Feature","\u002Fdocs\u002Fmcp\u002Fexamples\u002Fbuilding-a-feature","docs\u002Fmcp\u002F4.examples\u002F2.building-a-feature",{"title":258,"path":259,"stem":260},"Understanding Models","\u002Fdocs\u002Fmcp\u002Fexamples\u002Funderstanding-models","docs\u002Fmcp\u002F4.examples\u002F3.understanding-models",{"title":262,"path":263,"stem":264},"Code Review","\u002Fdocs\u002Fmcp\u002Fexamples\u002Fcode-review","docs\u002Fmcp\u002F4.examples\u002F4.code-review",{"title":266,"path":267,"stem":268},"Combining MCP Servers","\u002Fdocs\u002Fmcp\u002Fexamples\u002Fmulti-mcp","docs\u002Fmcp\u002F4.examples\u002F5.multi-mcp",{"title":270,"path":271,"stem":272},"Tips","\u002Fdocs\u002Fmcp\u002Fexamples\u002Ftips","docs\u002Fmcp\u002F4.examples\u002F6.tips",{"title":274,"path":275,"stem":276,"children":277,"page":31},"Storefront SDK","\u002Fdocs\u002Fstorefront-sdk","docs\u002Fstorefront-sdk",[278,290,323,338],{"title":11,"path":279,"stem":280,"children":281,"page":31},"\u002Fdocs\u002Fstorefront-sdk\u002Fgetting-started","docs\u002Fstorefront-sdk\u002F1.getting-started",[282,286],{"title":283,"path":284,"stem":285},"Installation","\u002Fdocs\u002Fstorefront-sdk\u002Fgetting-started\u002Finstallation","docs\u002Fstorefront-sdk\u002F1.getting-started\u002F1.installation",{"title":287,"path":288,"stem":289},"Configuration","\u002Fdocs\u002Fstorefront-sdk\u002Fgetting-started\u002Fconfiguration","docs\u002Fstorefront-sdk\u002F1.getting-started\u002F2.configuration",{"title":291,"path":292,"stem":293,"children":294,"page":31},"Resources","\u002Fdocs\u002Fstorefront-sdk\u002Fresources","docs\u002Fstorefront-sdk\u002F2.resources",[295,299,303,307,311,315,319],{"title":296,"path":297,"stem":298},"Products","\u002Fdocs\u002Fstorefront-sdk\u002Fresources\u002Fproducts","docs\u002Fstorefront-sdk\u002F2.resources\u002F1.products",{"title":300,"path":301,"stem":302},"Cart","\u002Fdocs\u002Fstorefront-sdk\u002Fresources\u002Fcart","docs\u002Fstorefront-sdk\u002F2.resources\u002F2.cart",{"title":304,"path":305,"stem":306},"Auth","\u002Fdocs\u002Fstorefront-sdk\u002Fresources\u002Fauth","docs\u002Fstorefront-sdk\u002F2.resources\u002F3.auth",{"title":308,"path":309,"stem":310},"Checkout & Shipping","\u002Fdocs\u002Fstorefront-sdk\u002Fresources\u002Fcheckout-shipping","docs\u002Fstorefront-sdk\u002F2.resources\u002F4.checkout-shipping",{"title":312,"path":313,"stem":314},"Orders, Returns & Reviews","\u002Fdocs\u002Fstorefront-sdk\u002Fresources\u002Forders-returns-reviews","docs\u002Fstorefront-sdk\u002F2.resources\u002F5.orders-returns-reviews",{"title":316,"path":317,"stem":318},"Customer assistant","\u002Fdocs\u002Fstorefront-sdk\u002Fresources\u002Fassistant","docs\u002Fstorefront-sdk\u002F2.resources\u002F6.assistant",{"title":320,"path":321,"stem":322},"Products in images","\u002Fdocs\u002Fstorefront-sdk\u002Fresources\u002Fproducts-in-images","docs\u002Fstorefront-sdk\u002F2.resources\u002F7.products-in-images",{"title":128,"path":324,"stem":325,"children":326,"page":31},"\u002Fdocs\u002Fstorefront-sdk\u002Fnuxt-layer","docs\u002Fstorefront-sdk\u002F3.nuxt-layer",[327,331,335],{"title":328,"path":329,"stem":330},"Overview","\u002Fdocs\u002Fstorefront-sdk\u002Fnuxt-layer\u002Foverview","docs\u002Fstorefront-sdk\u002F3.nuxt-layer\u002F1.overview",{"title":332,"path":333,"stem":334},"Composables","\u002Fdocs\u002Fstorefront-sdk\u002Fnuxt-layer\u002Fcomposables","docs\u002Fstorefront-sdk\u002F3.nuxt-layer\u002F2.composables",{"title":316,"path":336,"stem":337},"\u002Fdocs\u002Fstorefront-sdk\u002Fnuxt-layer\u002Fassistant","docs\u002Fstorefront-sdk\u002F3.nuxt-layer\u002F3.assistant",{"title":67,"path":339,"stem":340,"children":341,"page":31},"\u002Fdocs\u002Fstorefront-sdk\u002Fnextjs","docs\u002Fstorefront-sdk\u002F4.nextjs",[342,345,349,353],{"title":328,"path":343,"stem":344},"\u002Fdocs\u002Fstorefront-sdk\u002Fnextjs\u002Foverview","docs\u002Fstorefront-sdk\u002F4.nextjs\u002F1.overview",{"title":346,"path":347,"stem":348},"Hooks","\u002Fdocs\u002Fstorefront-sdk\u002Fnextjs\u002Fhooks","docs\u002Fstorefront-sdk\u002F4.nextjs\u002F2.hooks",{"title":350,"path":351,"stem":352},"Server helpers and proxy","\u002Fdocs\u002Fstorefront-sdk\u002Fnextjs\u002Fserver","docs\u002Fstorefront-sdk\u002F4.nextjs\u002F3.server",{"title":354,"path":355,"stem":356},"Components","\u002Fdocs\u002Fstorefront-sdk\u002Fnextjs\u002Fcomponents","docs\u002Fstorefront-sdk\u002F4.nextjs\u002F4.components",{"id":358,"title":328,"body":359,"description":1772,"extension":1773,"links":1774,"meta":1775,"navigation":583,"path":343,"seo":1782,"stem":344,"__hash__":1783},"docs\u002Fdocs\u002Fstorefront-sdk\u002F4.nextjs\u002F1.overview.md",{"type":360,"value":361,"toc":1750},"minimark",[362,378,461,473,478,489,492,520,524,527,535,542,905,930,937,1002,1009,1117,1127,1134,1137,1197,1204,1303,1309,1316,1380,1389,1502,1506,1577,1584,1588,1681,1685,1688,1728,1732,1746],[363,364,365,369,370,373,374,377],"p",{},[366,367,368],"code",{},"@avvyr\u002Fstorefront-next"," is the Next.js counterpart of the ",[371,372,128],"a",{"href":329},". It is built on ",[366,375,376],{},"@avvyr\u002Fstorefront-sdk"," and gives an App Router project the same building blocks:",[379,380,381,406,424,430,449,455],"ul",{},[382,383,384,388,389,392,393,392,396,392,399,392,402,405],"li",{},[385,386,387],"strong",{},"React hooks",": ",[366,390,391],{},"useCart",", ",[366,394,395],{},"useAuth",[366,397,398],{},"useMarket",[366,400,401],{},"useProductSearch",[366,403,404],{},"useCheckout"," and more, with the same names and behaviour as the Nuxt composables. State is shared across components through one provider.",[382,407,408,388,411,392,414,392,417,392,420,423],{},[385,409,410],{},"Server helpers",[366,412,413],{},"storefront.client()",[366,415,416],{},"storefront.session()",[366,418,419],{},"storefront.cart()",[366,421,422],{},"storefront.categories()"," for Server Components, Route Handlers and Server Actions. The private key stays on the server.",[382,425,426,429],{},[385,427,428],{},"Session proxy",": refreshes the customer's access token before a page renders, resolves the market, and redirects signed-out visitors away from protected paths.",[382,431,432,388,435,392,438,441,442,445,446,448],{},[385,433,434],{},"Drop-in components",[366,436,437],{},"\u003CAvvyrCookieConsent \u002F>",[366,439,440],{},"\u003CAvvyrAssistant \u002F>"," and ",[366,443,444],{},"\u003CAvvyrPaymentWidget \u002F>",", the same components the Nuxt layer ships. See ",[371,447,354],{"href":355},".",[382,450,451,454],{},[385,452,453],{},"Analytics",": the GA4 dataLayer, Google Consent Mode v2 and Avvyr behavioural tracking, wired into the cart, auth and checkout hooks.",[382,456,457,460],{},[385,458,459],{},"Full B2B support",": customer registration, login (magic link, code and password), company accounts, order history and saved lists.",[462,463,465,466,469,470,448],"callout",{"icon":464},"i-lucide-rocket","Starting a new shop? The ",[385,467,468],{},"Next.js Storefront Starter"," is a complete project built on this package. See ",[371,471,283],{"href":472},"\u002Fdocs\u002Fstorefront-sdk\u002Fgetting-started\u002Finstallation#starter-templates",[474,475,477],"h2",{"id":476},"requirements","Requirements",[379,479,480,483,486],{},[382,481,482],{},"Next.js 15.3 or later (Next.js 16 recommended), App Router",[382,484,485],{},"React 19",[382,487,488],{},"Node.js 20.9 or later",[474,490,283],{"id":491},"installation",[493,494,499],"pre",{"className":495,"code":496,"language":497,"meta":498,"style":498},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npm install @avvyr\u002Fstorefront-next @avvyr\u002Fstorefront-sdk\n","bash","",[366,500,501],{"__ignoreMap":498},[502,503,506,510,514,517],"span",{"class":504,"line":505},"line",1,[502,507,509],{"class":508},"sBMFI","npm",[502,511,513],{"class":512},"sfazB"," install",[502,515,516],{"class":512}," @avvyr\u002Fstorefront-next",[502,518,519],{"class":512}," @avvyr\u002Fstorefront-sdk\n",[474,521,523],{"id":522},"setup","Setup",[363,525,526],{},"The package needs six small files. The starter has all of them already.",[528,529,531,532],"h3",{"id":530},"_1-storefrontconfigts","1. ",[366,533,534],{},"storefront.config.ts",[363,536,537,538,541],{},"The equivalent of ",[366,539,540],{},"appConfig.storefront"," in the Nuxt layer. Server code and client code both import it, so it must not contain secrets. Keys come from environment variables.",[493,543,547],{"className":544,"code":545,"language":546,"meta":498,"style":498},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineStorefrontConfig } from '@avvyr\u002Fstorefront-next\u002Fconfig'\n\nexport default defineStorefrontConfig({\n  store: {\n    strategy: 'cookie', \u002F\u002F 'path' | 'domain' | 'cookie'\n    default: 'se',\n    markets: [\n      { id: 'se', marketId: '676140c4136218caaf97d79e', name: 'Sverige', locale: 'sv-SE', i18n: 'sv', currency: 'SEK' },\n      { id: 'no', marketId: '676140c4136218caaf97d780', name: 'Norge', locale: 'nb-NO', i18n: 'nb', currency: 'NOK' },\n    ],\n  },\n  auth: {\n    protectedPaths: ['\u002Faccount'], \u002F\u002F signed-out visitors go to auth.loginPath (default \u002Flogin)\n  },\n})\n","ts",[366,548,549,578,585,603,616,639,657,668,758,841,849,855,865,891,896],{"__ignoreMap":498},[502,550,551,555,559,563,566,569,572,575],{"class":504,"line":505},[502,552,554],{"class":553},"s7zQu","import",[502,556,558],{"class":557},"sMK4o"," {",[502,560,562],{"class":561},"sTEyZ"," defineStorefrontConfig",[502,564,565],{"class":557}," }",[502,567,568],{"class":553}," from",[502,570,571],{"class":557}," '",[502,573,574],{"class":512},"@avvyr\u002Fstorefront-next\u002Fconfig",[502,576,577],{"class":557},"'\n",[502,579,581],{"class":504,"line":580},2,[502,582,584],{"emptyLinePlaceholder":583},true,"\n",[502,586,588,591,594,597,600],{"class":504,"line":587},3,[502,589,590],{"class":553},"export",[502,592,593],{"class":553}," default",[502,595,562],{"class":596},"s2Zo4",[502,598,599],{"class":561},"(",[502,601,602],{"class":557},"{\n",[502,604,606,610,613],{"class":504,"line":605},4,[502,607,609],{"class":608},"swJcz","  store",[502,611,612],{"class":557},":",[502,614,615],{"class":557}," {\n",[502,617,619,622,624,626,629,632,635],{"class":504,"line":618},5,[502,620,621],{"class":608},"    strategy",[502,623,612],{"class":557},[502,625,571],{"class":557},[502,627,628],{"class":512},"cookie",[502,630,631],{"class":557},"'",[502,633,634],{"class":557},",",[502,636,638],{"class":637},"sHwdD"," \u002F\u002F 'path' | 'domain' | 'cookie'\n",[502,640,642,645,647,649,652,654],{"class":504,"line":641},6,[502,643,644],{"class":608},"    default",[502,646,612],{"class":557},[502,648,571],{"class":557},[502,650,651],{"class":512},"se",[502,653,631],{"class":557},[502,655,656],{"class":557},",\n",[502,658,660,663,665],{"class":504,"line":659},7,[502,661,662],{"class":608},"    markets",[502,664,612],{"class":557},[502,666,667],{"class":561}," [\n",[502,669,671,674,677,679,681,683,685,687,690,692,694,697,699,701,704,706,708,711,713,715,718,720,722,725,727,729,732,734,736,739,741,743,746,748,750,753,755],{"class":504,"line":670},8,[502,672,673],{"class":557},"      {",[502,675,676],{"class":608}," id",[502,678,612],{"class":557},[502,680,571],{"class":557},[502,682,651],{"class":512},[502,684,631],{"class":557},[502,686,634],{"class":557},[502,688,689],{"class":608}," marketId",[502,691,612],{"class":557},[502,693,571],{"class":557},[502,695,696],{"class":512},"676140c4136218caaf97d79e",[502,698,631],{"class":557},[502,700,634],{"class":557},[502,702,703],{"class":608}," name",[502,705,612],{"class":557},[502,707,571],{"class":557},[502,709,710],{"class":512},"Sverige",[502,712,631],{"class":557},[502,714,634],{"class":557},[502,716,717],{"class":608}," locale",[502,719,612],{"class":557},[502,721,571],{"class":557},[502,723,724],{"class":512},"sv-SE",[502,726,631],{"class":557},[502,728,634],{"class":557},[502,730,731],{"class":608}," i18n",[502,733,612],{"class":557},[502,735,571],{"class":557},[502,737,738],{"class":512},"sv",[502,740,631],{"class":557},[502,742,634],{"class":557},[502,744,745],{"class":608}," currency",[502,747,612],{"class":557},[502,749,571],{"class":557},[502,751,752],{"class":512},"SEK",[502,754,631],{"class":557},[502,756,757],{"class":557}," },\n",[502,759,761,763,765,767,769,772,774,776,778,780,782,785,787,789,791,793,795,798,800,802,804,806,808,811,813,815,817,819,821,824,826,828,830,832,834,837,839],{"class":504,"line":760},9,[502,762,673],{"class":557},[502,764,676],{"class":608},[502,766,612],{"class":557},[502,768,571],{"class":557},[502,770,771],{"class":512},"no",[502,773,631],{"class":557},[502,775,634],{"class":557},[502,777,689],{"class":608},[502,779,612],{"class":557},[502,781,571],{"class":557},[502,783,784],{"class":512},"676140c4136218caaf97d780",[502,786,631],{"class":557},[502,788,634],{"class":557},[502,790,703],{"class":608},[502,792,612],{"class":557},[502,794,571],{"class":557},[502,796,797],{"class":512},"Norge",[502,799,631],{"class":557},[502,801,634],{"class":557},[502,803,717],{"class":608},[502,805,612],{"class":557},[502,807,571],{"class":557},[502,809,810],{"class":512},"nb-NO",[502,812,631],{"class":557},[502,814,634],{"class":557},[502,816,731],{"class":608},[502,818,612],{"class":557},[502,820,571],{"class":557},[502,822,823],{"class":512},"nb",[502,825,631],{"class":557},[502,827,634],{"class":557},[502,829,745],{"class":608},[502,831,612],{"class":557},[502,833,571],{"class":557},[502,835,836],{"class":512},"NOK",[502,838,631],{"class":557},[502,840,757],{"class":557},[502,842,844,847],{"class":504,"line":843},10,[502,845,846],{"class":561},"    ]",[502,848,656],{"class":557},[502,850,852],{"class":504,"line":851},11,[502,853,854],{"class":557},"  },\n",[502,856,858,861,863],{"class":504,"line":857},12,[502,859,860],{"class":608},"  auth",[502,862,612],{"class":557},[502,864,615],{"class":557},[502,866,868,871,873,876,878,881,883,886,888],{"class":504,"line":867},13,[502,869,870],{"class":608},"    protectedPaths",[502,872,612],{"class":557},[502,874,875],{"class":561}," [",[502,877,631],{"class":557},[502,879,880],{"class":512},"\u002Faccount",[502,882,631],{"class":557},[502,884,885],{"class":561},"]",[502,887,634],{"class":557},[502,889,890],{"class":637}," \u002F\u002F signed-out visitors go to auth.loginPath (default \u002Flogin)\n",[502,892,894],{"class":504,"line":893},14,[502,895,854],{"class":557},[502,897,899,902],{"class":504,"line":898},15,[502,900,901],{"class":557},"}",[502,903,904],{"class":561},")\n",[363,906,907,908,392,911,392,914,392,917,392,920,441,923,926,927,448],{},"Every other key has a default: cookie names, ",[366,909,910],{},"tracking",[366,912,913],{},"analytics",[366,915,916],{},"consent",[366,918,919],{},"assistant",[366,921,922],{},"variants",[366,924,925],{},"interceptors",". They behave the same as in the ",[371,928,128],{"href":929},"\u002Fdocs\u002Fstorefront-sdk\u002Fnuxt-layer\u002Foverview#configure",[528,931,933,934],{"id":932},"_2-libstorefrontts","2. ",[366,935,936],{},"lib\u002Fstorefront.ts",[493,938,940],{"className":544,"code":939,"language":546,"meta":498,"style":498},"import { createStorefrontServer } from '@avvyr\u002Fstorefront-next\u002Fserver'\nimport config from '@\u002Fstorefront.config'\n\nexport const storefront = createStorefrontServer(config)\n",[366,941,942,962,979,983],{"__ignoreMap":498},[502,943,944,946,948,951,953,955,957,960],{"class":504,"line":505},[502,945,554],{"class":553},[502,947,558],{"class":557},[502,949,950],{"class":561}," createStorefrontServer",[502,952,565],{"class":557},[502,954,568],{"class":553},[502,956,571],{"class":557},[502,958,959],{"class":512},"@avvyr\u002Fstorefront-next\u002Fserver",[502,961,577],{"class":557},[502,963,964,966,969,972,974,977],{"class":504,"line":580},[502,965,554],{"class":553},[502,967,968],{"class":561}," config ",[502,970,971],{"class":553},"from",[502,973,571],{"class":557},[502,975,976],{"class":512},"@\u002Fstorefront.config",[502,978,577],{"class":557},[502,980,981],{"class":504,"line":587},[502,982,584],{"emptyLinePlaceholder":583},[502,984,985,987,991,994,997,999],{"class":504,"line":605},[502,986,590],{"class":553},[502,988,990],{"class":989},"spNyl"," const",[502,992,993],{"class":561}," storefront ",[502,995,996],{"class":557},"=",[502,998,950],{"class":596},[502,1000,1001],{"class":561},"(config)\n",[528,1003,1005,1006],{"id":1004},"_3-proxyts","3. ",[366,1007,1008],{},"proxy.ts",[493,1010,1012],{"className":544,"code":1011,"language":546,"meta":498,"style":498},"import { createStorefrontProxy } from '@avvyr\u002Fstorefront-next\u002Fproxy'\nimport storefrontConfig from '.\u002Fstorefront.config'\n\nexport const proxy = createStorefrontProxy(storefrontConfig)\n\n\u002F\u002F Next.js requires a static literal here.\nexport const config = { matcher: ['\u002F((?!_next\u002F|favicon.ico|.*\\\\..*).*)'] }\n",[366,1013,1014,1034,1050,1054,1070,1074,1079],{"__ignoreMap":498},[502,1015,1016,1018,1020,1023,1025,1027,1029,1032],{"class":504,"line":505},[502,1017,554],{"class":553},[502,1019,558],{"class":557},[502,1021,1022],{"class":561}," createStorefrontProxy",[502,1024,565],{"class":557},[502,1026,568],{"class":553},[502,1028,571],{"class":557},[502,1030,1031],{"class":512},"@avvyr\u002Fstorefront-next\u002Fproxy",[502,1033,577],{"class":557},[502,1035,1036,1038,1041,1043,1045,1048],{"class":504,"line":580},[502,1037,554],{"class":553},[502,1039,1040],{"class":561}," storefrontConfig ",[502,1042,971],{"class":553},[502,1044,571],{"class":557},[502,1046,1047],{"class":512},".\u002Fstorefront.config",[502,1049,577],{"class":557},[502,1051,1052],{"class":504,"line":587},[502,1053,584],{"emptyLinePlaceholder":583},[502,1055,1056,1058,1060,1063,1065,1067],{"class":504,"line":605},[502,1057,590],{"class":553},[502,1059,990],{"class":989},[502,1061,1062],{"class":561}," proxy ",[502,1064,996],{"class":557},[502,1066,1022],{"class":596},[502,1068,1069],{"class":561},"(storefrontConfig)\n",[502,1071,1072],{"class":504,"line":618},[502,1073,584],{"emptyLinePlaceholder":583},[502,1075,1076],{"class":504,"line":641},[502,1077,1078],{"class":637},"\u002F\u002F Next.js requires a static literal here.\n",[502,1080,1081,1083,1085,1087,1089,1091,1094,1096,1098,1100,1103,1106,1109,1111,1114],{"class":504,"line":659},[502,1082,590],{"class":553},[502,1084,990],{"class":989},[502,1086,968],{"class":561},[502,1088,996],{"class":557},[502,1090,558],{"class":557},[502,1092,1093],{"class":608}," matcher",[502,1095,612],{"class":557},[502,1097,875],{"class":561},[502,1099,631],{"class":557},[502,1101,1102],{"class":512},"\u002F((?!_next\u002F|favicon.ico|.*",[502,1104,1105],{"class":561},"\\\\",[502,1107,1108],{"class":512},"..*).*)",[502,1110,631],{"class":557},[502,1112,1113],{"class":561},"] ",[502,1115,1116],{"class":557},"}\n",[363,1118,1119,1120,1123,1124,448],{},"On Next.js 15, name the file ",[366,1121,1122],{},"middleware.ts"," and the export ",[366,1125,1126],{},"middleware",[528,1128,1130,1131],{"id":1129},"_4-appproviderstsx","4. ",[366,1132,1133],{},"app\u002Fproviders.tsx",[363,1135,1136],{},"The provider is rendered from your own client component, because the config can contain functions (interceptors) and functions cannot be passed from the server as props.",[493,1138,1142],{"className":1139,"code":1140,"language":1141,"meta":498,"style":498},"language-tsx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","'use client'\nimport { StorefrontProvider, type StorefrontInitialState } from '@avvyr\u002Fstorefront-next'\nimport config from '@\u002Fstorefront.config'\n\nexport function Providers({ initialState, children }: { initialState: StorefrontInitialState; children: React.ReactNode }) {\n  return (\n    \u003CStorefrontProvider config={config} initialState={initialState}>\n      {children}\n    \u003C\u002FStorefrontProvider>\n  )\n}\n","tsx",[366,1143,1144,1149,1154,1159,1163,1168,1173,1178,1183,1188,1193],{"__ignoreMap":498},[502,1145,1146],{"class":504,"line":505},[502,1147,1148],{},"'use client'\n",[502,1150,1151],{"class":504,"line":580},[502,1152,1153],{},"import { StorefrontProvider, type StorefrontInitialState } from '@avvyr\u002Fstorefront-next'\n",[502,1155,1156],{"class":504,"line":587},[502,1157,1158],{},"import config from '@\u002Fstorefront.config'\n",[502,1160,1161],{"class":504,"line":605},[502,1162,584],{"emptyLinePlaceholder":583},[502,1164,1165],{"class":504,"line":618},[502,1166,1167],{},"export function Providers({ initialState, children }: { initialState: StorefrontInitialState; children: React.ReactNode }) {\n",[502,1169,1170],{"class":504,"line":641},[502,1171,1172],{},"  return (\n",[502,1174,1175],{"class":504,"line":659},[502,1176,1177],{},"    \u003CStorefrontProvider config={config} initialState={initialState}>\n",[502,1179,1180],{"class":504,"line":670},[502,1181,1182],{},"      {children}\n",[502,1184,1185],{"class":504,"line":760},[502,1186,1187],{},"    \u003C\u002FStorefrontProvider>\n",[502,1189,1190],{"class":504,"line":843},[502,1191,1192],{},"  )\n",[502,1194,1195],{"class":504,"line":851},[502,1196,1116],{},[528,1198,1200,1201],{"id":1199},"_5-applayouttsx","5. ",[366,1202,1203],{},"app\u002Flayout.tsx",[493,1205,1207],{"className":1139,"code":1206,"language":1141,"meta":498,"style":498},"import { StorefrontScripts } from '@avvyr\u002Fstorefront-next\u002Fserver'\nimport '@avvyr\u002Fstorefront-next\u002Fstyles.css'\nimport config from '@\u002Fstorefront.config'\nimport { storefront } from '@\u002Flib\u002Fstorefront'\nimport { Providers } from '.\u002Fproviders'\n\nexport default async function RootLayout({ children }: { children: React.ReactNode }) {\n  const initialState = await storefront.initialState()\n  return (\n    \u003Chtml lang={initialState.market.i18n}>\n      \u003Chead>\n        \u003CStorefrontScripts config={config} market={initialState.market} \u002F>\n      \u003C\u002Fhead>\n      \u003Cbody>\n        \u003CProviders initialState={initialState}>{children}\u003C\u002FProviders>\n      \u003C\u002Fbody>\n    \u003C\u002Fhtml>\n  )\n}\n",[366,1208,1209,1214,1219,1223,1228,1233,1237,1242,1247,1251,1256,1261,1266,1271,1276,1281,1287,1293,1298],{"__ignoreMap":498},[502,1210,1211],{"class":504,"line":505},[502,1212,1213],{},"import { StorefrontScripts } from '@avvyr\u002Fstorefront-next\u002Fserver'\n",[502,1215,1216],{"class":504,"line":580},[502,1217,1218],{},"import '@avvyr\u002Fstorefront-next\u002Fstyles.css'\n",[502,1220,1221],{"class":504,"line":587},[502,1222,1158],{},[502,1224,1225],{"class":504,"line":605},[502,1226,1227],{},"import { storefront } from '@\u002Flib\u002Fstorefront'\n",[502,1229,1230],{"class":504,"line":618},[502,1231,1232],{},"import { Providers } from '.\u002Fproviders'\n",[502,1234,1235],{"class":504,"line":641},[502,1236,584],{"emptyLinePlaceholder":583},[502,1238,1239],{"class":504,"line":659},[502,1240,1241],{},"export default async function RootLayout({ children }: { children: React.ReactNode }) {\n",[502,1243,1244],{"class":504,"line":670},[502,1245,1246],{},"  const initialState = await storefront.initialState()\n",[502,1248,1249],{"class":504,"line":760},[502,1250,1172],{},[502,1252,1253],{"class":504,"line":843},[502,1254,1255],{},"    \u003Chtml lang={initialState.market.i18n}>\n",[502,1257,1258],{"class":504,"line":851},[502,1259,1260],{},"      \u003Chead>\n",[502,1262,1263],{"class":504,"line":857},[502,1264,1265],{},"        \u003CStorefrontScripts config={config} market={initialState.market} \u002F>\n",[502,1267,1268],{"class":504,"line":867},[502,1269,1270],{},"      \u003C\u002Fhead>\n",[502,1272,1273],{"class":504,"line":893},[502,1274,1275],{},"      \u003Cbody>\n",[502,1277,1278],{"class":504,"line":898},[502,1279,1280],{},"        \u003CProviders initialState={initialState}>{children}\u003C\u002FProviders>\n",[502,1282,1284],{"class":504,"line":1283},16,[502,1285,1286],{},"      \u003C\u002Fbody>\n",[502,1288,1290],{"class":504,"line":1289},17,[502,1291,1292],{},"    \u003C\u002Fhtml>\n",[502,1294,1296],{"class":504,"line":1295},18,[502,1297,1192],{},[502,1299,1301],{"class":504,"line":1300},19,[502,1302,1116],{},[363,1304,1305,1308],{},[366,1306,1307],{},"initialState()"," reads the request's cookies, resolves the market, and fetches the cart on the server. The first render therefore already shows the cart, as the Nuxt layer's cart-restore plugin does.",[528,1310,1312,1313],{"id":1311},"_6-appapistorefrontcategoriesroutets","6. ",[366,1314,1315],{},"app\u002Fapi\u002Fstorefront\u002Fcategories\u002Froute.ts",[493,1317,1319],{"className":544,"code":1318,"language":546,"meta":498,"style":498},"import { createCategoriesHandler } from '@avvyr\u002Fstorefront-next\u002Fserver'\nimport { storefront } from '@\u002Flib\u002Fstorefront'\n\nexport const GET = createCategoriesHandler(storefront)\n",[366,1320,1321,1340,1360,1364],{"__ignoreMap":498},[502,1322,1323,1325,1327,1330,1332,1334,1336,1338],{"class":504,"line":505},[502,1324,554],{"class":553},[502,1326,558],{"class":557},[502,1328,1329],{"class":561}," createCategoriesHandler",[502,1331,565],{"class":557},[502,1333,568],{"class":553},[502,1335,571],{"class":557},[502,1337,959],{"class":512},[502,1339,577],{"class":557},[502,1341,1342,1344,1346,1349,1351,1353,1355,1358],{"class":504,"line":580},[502,1343,554],{"class":553},[502,1345,558],{"class":557},[502,1347,1348],{"class":561}," storefront",[502,1350,565],{"class":557},[502,1352,568],{"class":553},[502,1354,571],{"class":557},[502,1356,1357],{"class":512},"@\u002Flib\u002Fstorefront",[502,1359,577],{"class":557},[502,1361,1362],{"class":504,"line":587},[502,1363,584],{"emptyLinePlaceholder":583},[502,1365,1366,1368,1370,1373,1375,1377],{"class":504,"line":605},[502,1367,590],{"class":553},[502,1369,990],{"class":989},[502,1371,1372],{"class":561}," GET ",[502,1374,996],{"class":557},[502,1376,1329],{"class":596},[502,1378,1379],{"class":561},"(storefront)\n",[363,1381,1382,1385,1386,612],{},[366,1383,1384],{},"useCategories()"," reads from this route. The route serves the server's in-memory category cache (stale-while-revalidate, 5 minutes by default), so client navigation never calls the Avvyr API for categories. To warm the cache on boot, add ",[366,1387,1388],{},"instrumentation.ts",[493,1390,1392],{"className":544,"code":1391,"language":546,"meta":498,"style":498},"export async function register() {\n  if (process.env.NEXT_RUNTIME === 'nodejs') {\n    const { storefront } = await import('@\u002Flib\u002Fstorefront')\n    void storefront.warmCategories()\n  }\n}\n",[366,1393,1394,1412,1448,1478,1493,1498],{"__ignoreMap":498},[502,1395,1396,1398,1401,1404,1407,1410],{"class":504,"line":505},[502,1397,590],{"class":553},[502,1399,1400],{"class":989}," async",[502,1402,1403],{"class":989}," function",[502,1405,1406],{"class":596}," register",[502,1408,1409],{"class":557},"()",[502,1411,615],{"class":557},[502,1413,1414,1417,1420,1423,1425,1428,1430,1433,1436,1438,1441,1443,1446],{"class":504,"line":580},[502,1415,1416],{"class":553},"  if",[502,1418,1419],{"class":608}," (",[502,1421,1422],{"class":561},"process",[502,1424,448],{"class":557},[502,1426,1427],{"class":561},"env",[502,1429,448],{"class":557},[502,1431,1432],{"class":561},"NEXT_RUNTIME",[502,1434,1435],{"class":557}," ===",[502,1437,571],{"class":557},[502,1439,1440],{"class":512},"nodejs",[502,1442,631],{"class":557},[502,1444,1445],{"class":608},") ",[502,1447,602],{"class":557},[502,1449,1450,1453,1455,1457,1459,1462,1465,1468,1470,1472,1474,1476],{"class":504,"line":587},[502,1451,1452],{"class":989},"    const",[502,1454,558],{"class":557},[502,1456,1348],{"class":561},[502,1458,565],{"class":557},[502,1460,1461],{"class":557}," =",[502,1463,1464],{"class":553}," await",[502,1466,1467],{"class":557}," import",[502,1469,599],{"class":608},[502,1471,631],{"class":557},[502,1473,1357],{"class":512},[502,1475,631],{"class":557},[502,1477,904],{"class":608},[502,1479,1480,1483,1485,1487,1490],{"class":504,"line":605},[502,1481,1482],{"class":557},"    void",[502,1484,1348],{"class":561},[502,1486,448],{"class":557},[502,1488,1489],{"class":596},"warmCategories",[502,1491,1492],{"class":608},"()\n",[502,1494,1495],{"class":504,"line":618},[502,1496,1497],{"class":557},"  }\n",[502,1499,1500],{"class":504,"line":641},[502,1501,1116],{"class":557},[474,1503,1505],{"id":1504},"environment-variables","Environment variables",[493,1507,1509],{"className":495,"code":1508,"language":497,"meta":498,"style":498},"NEXT_PUBLIC_STOREFRONT_BASE_URL=https:\u002F\u002Fapi.avvyr.com\nNEXT_PUBLIC_STOREFRONT_PUBLIC_KEY=sfp_your_public_key\nSTOREFRONT_PRIVATE_KEY=sfs_your_private_key      # server only\nNEXT_PUBLIC_STOREFRONT_CDN_URL=https:\u002F\u002Fassets.avvyr.com\nNEXT_PUBLIC_GTM_ID=                              # optional, wins over config.analytics.gtm.id\nSTOREFRONT_CATEGORIES_TTL_MS=300000              # optional\n",[366,1510,1511,1521,1531,1544,1554,1564],{"__ignoreMap":498},[502,1512,1513,1516,1518],{"class":504,"line":505},[502,1514,1515],{"class":561},"NEXT_PUBLIC_STOREFRONT_BASE_URL",[502,1517,996],{"class":557},[502,1519,1520],{"class":512},"https:\u002F\u002Fapi.avvyr.com\n",[502,1522,1523,1526,1528],{"class":504,"line":580},[502,1524,1525],{"class":561},"NEXT_PUBLIC_STOREFRONT_PUBLIC_KEY",[502,1527,996],{"class":557},[502,1529,1530],{"class":512},"sfp_your_public_key\n",[502,1532,1533,1536,1538,1541],{"class":504,"line":587},[502,1534,1535],{"class":561},"STOREFRONT_PRIVATE_KEY",[502,1537,996],{"class":557},[502,1539,1540],{"class":512},"sfs_your_private_key",[502,1542,1543],{"class":637},"      # server only\n",[502,1545,1546,1549,1551],{"class":504,"line":605},[502,1547,1548],{"class":561},"NEXT_PUBLIC_STOREFRONT_CDN_URL",[502,1550,996],{"class":557},[502,1552,1553],{"class":512},"https:\u002F\u002Fassets.avvyr.com\n",[502,1555,1556,1559,1561],{"class":504,"line":618},[502,1557,1558],{"class":561},"NEXT_PUBLIC_GTM_ID",[502,1560,996],{"class":557},[502,1562,1563],{"class":637},"                              # optional, wins over config.analytics.gtm.id\n",[502,1565,1566,1569,1571,1574],{"class":504,"line":641},[502,1567,1568],{"class":561},"STOREFRONT_CATEGORIES_TTL_MS",[502,1570,996],{"class":557},[502,1572,1573],{"class":512},"300000",[502,1575,1576],{"class":637},"              # optional\n",[363,1578,1579,1580,1583],{},"Only the server reads these variables. The public values reach the browser through ",[366,1581,1582],{},"initialState",", and the private key never does.",[474,1585,1587],{"id":1586},"market-strategies","Market strategies",[1589,1590,1591,1607],"table",{},[1592,1593,1594],"thead",{},[1595,1596,1597,1601,1604],"tr",{},[1598,1599,1600],"th",{},"Strategy",[1598,1602,1603],{},"How the market is resolved",[1598,1605,1606],{},"Switching",[1608,1609,1610,1635,1658],"tbody",{},[1595,1611,1612,1618,1629],{},[1613,1614,1615],"td",{},[366,1616,1617],{},"path",[1613,1619,1620,1621,1624,1625,1628],{},"URL prefix: ",[366,1622,1623],{},"\u002Fno\u002Fproducts",". The default market has no prefix. The proxy rewrites the prefix away, so pages need no ",[366,1626,1627],{},"[market]"," segment.",[1613,1630,1631,1632],{},"Links use ",[366,1633,1634],{},"useMarket().path('\u002Fproducts')",[1595,1636,1637,1642,1655],{},[1613,1638,1639],{},[366,1640,1641],{},"domain",[1613,1643,1644,1645,392,1647,1650,1651,1654],{},"Hostname: ",[366,1646,1641],{},[366,1648,1649],{},"stagingDomain"," or ",[366,1652,1653],{},"devDomain"," on each market",[1613,1656,1657],{},"Navigate to the other domain",[1595,1659,1660,1664,1675],{},[1613,1661,1662],{},[366,1663,628],{},[1613,1665,1666,1667,1670,1671,1674],{},"The ",[366,1668,1669],{},"avvyr_market"," cookie (",[366,1672,1673],{},"store.cookieName","). Works on a single domain, which makes it practical in development",[1613,1676,1677,1680],{},[366,1678,1679],{},"useMarket().switchMarket('no')"," writes the cookie and reloads",[474,1682,1684],{"id":1683},"how-sessions-work","How sessions work",[363,1686,1687],{},"Customer and cart tokens are stored in cookies, so the browser and the server see the same session.",[379,1689,1690,1700,1714],{},[382,1691,1692,1695,1696,1699],{},[385,1693,1694],{},"In the browser"," the SDK client retries any ",[366,1697,1698],{},"401"," once after refreshing the token. Concurrent refreshes share a single request.",[382,1701,1702,1705,1706,1709,1710,1713],{},[385,1703,1704],{},"On the server",", Server Components cannot write cookies. The platform rotates the refresh token every time it is used, and it ends the session if an old token is used again. The proxy therefore refreshes an access token that has expired, or expires within ",[366,1707,1708],{},"auth.refreshSkewSeconds"," (default 120). It does this ",[385,1711,1712],{},"before"," rendering, writes the new cookies to the response, and passes them to the page in the same request. Requests that arrive at the same time with the same refresh token (for example, parallel link prefetches) share one refresh.",[382,1715,1716,1719,1720,1723,1724,1727],{},[385,1717,1718],{},"Signing in or out reloads the page"," so that every cache is rebuilt for the new identity. This includes product cards fetched while anonymous on a market with ",[366,1721,1722],{},"pricesRequireLogin",". Turn it off with ",[366,1725,1726],{},"\u003CStorefrontProvider reloadOnSessionChange={false}>"," only if you invalidate those caches yourself.",[474,1729,1731],{"id":1730},"next-steps","Next steps",[379,1733,1734,1738,1742],{},[382,1735,1736],{},[371,1737,346],{"href":347},[382,1739,1740],{},[371,1741,350],{"href":351},[382,1743,1744],{},[371,1745,354],{"href":355},[1747,1748,1749],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}",{"title":498,"searchDepth":580,"depth":580,"links":1751},[1752,1753,1754,1768,1769,1770,1771],{"id":476,"depth":580,"text":477},{"id":491,"depth":580,"text":283},{"id":522,"depth":580,"text":523,"children":1755},[1756,1758,1760,1762,1764,1766],{"id":530,"depth":587,"text":1757},"1. storefront.config.ts",{"id":932,"depth":587,"text":1759},"2. lib\u002Fstorefront.ts",{"id":1004,"depth":587,"text":1761},"3. proxy.ts",{"id":1129,"depth":587,"text":1763},"4. app\u002Fproviders.tsx",{"id":1199,"depth":587,"text":1765},"5. app\u002Flayout.tsx",{"id":1311,"depth":587,"text":1767},"6. app\u002Fapi\u002Fstorefront\u002Fcategories\u002Froute.ts",{"id":1504,"depth":580,"text":1505},{"id":1586,"depth":580,"text":1587},{"id":1683,"depth":580,"text":1684},{"id":1730,"depth":580,"text":1731},"What @avvyr\u002Fstorefront-next gives you and how to add it to a Next.js App Router project","md",null,{"questions":1776},{"en":1777},[1778,1779,1780,1781],"How do I add the Storefront SDK to a Next.js project?","Which files do I need to create for @avvyr\u002Fstorefront-next?","How does the Next.js package keep customers signed in?","Which environment variables does the Next.js package read?",{"title":328,"description":1772},"lGRBvKi3WmzR3U_TsDOxLiYMdclOG9e3FRLNnupDj4o",[1785,1787],{"title":316,"path":336,"stem":337,"description":1786,"children":-1},"The drop-in chat widget \u003CAvvyrAssistant \u002F> and the useAssistant() composable",{"title":346,"path":347,"stem":348,"description":1788,"children":-1},"All React hooks provided by @avvyr\u002Fstorefront-next",1793388941819]