[{"data":1,"prerenderedAt":2085},["ShallowReactive",2],{"navigation_docs":3,"-docs-storefront-sdk-resources-auth":357,"-docs-storefront-sdk-resources-auth-surround":2080,"docs-site-config":2070},[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":304,"body":359,"description":2068,"extension":2069,"links":2070,"meta":2071,"navigation":643,"path":305,"seo":2078,"stem":306,"__hash__":2079},"docs\u002Fdocs\u002Fstorefront-sdk\u002F2.resources\u002F3.auth.md",{"type":360,"value":361,"toc":2051},"minimark",[362,371,382,387,394,397,503,509,512,588,601,609,724,739,742,748,755,804,830,836,846,1632,1643,1646,1682,1685,1694,1708,1775,1781,1784,1818,1824,1845,1854,1943,1947,2047],[363,364,365,366,370],"p",{},"Access via ",[367,368,369],"code",{},"client.auth",".",[363,372,373,374,377,378,381],{},"After a successful login or magic link verification the SDK stores the ",[367,375,376],{},"accessToken"," internally and sends it as ",[367,379,380],{},"Authorization: Bearer"," on subsequent requests.",[383,384,386],"h2",{"id":385},"methods","Methods",[388,389,391],"h3",{"id":390},"loginparams",[367,392,393],{},"login(params)",[363,395,396],{},"Email + password login.",[398,399,404],"pre",{"className":400,"code":401,"language":402,"meta":403,"style":403},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","const response = await client.auth.login({\n  email: 'customer@example.com',\n  password: 'secret',\n})\n\u002F\u002F response.customer, response.accessToken, response.refreshToken\n","ts","",[367,405,406,447,470,487,496],{"__ignoreMap":403},[407,408,411,415,419,423,427,430,432,435,437,441,444],"span",{"class":409,"line":410},"line",1,[407,412,414],{"class":413},"spNyl","const",[407,416,418],{"class":417},"sTEyZ"," response ",[407,420,422],{"class":421},"sMK4o","=",[407,424,426],{"class":425},"s7zQu"," await",[407,428,429],{"class":417}," client",[407,431,370],{"class":421},[407,433,434],{"class":417},"auth",[407,436,370],{"class":421},[407,438,440],{"class":439},"s2Zo4","login",[407,442,443],{"class":417},"(",[407,445,446],{"class":421},"{\n",[407,448,450,454,457,460,464,467],{"class":409,"line":449},2,[407,451,453],{"class":452},"swJcz","  email",[407,455,456],{"class":421},":",[407,458,459],{"class":421}," '",[407,461,463],{"class":462},"sfazB","customer@example.com",[407,465,466],{"class":421},"'",[407,468,469],{"class":421},",\n",[407,471,473,476,478,480,483,485],{"class":409,"line":472},3,[407,474,475],{"class":452},"  password",[407,477,456],{"class":421},[407,479,459],{"class":421},[407,481,482],{"class":462},"secret",[407,484,466],{"class":421},[407,486,469],{"class":421},[407,488,490,493],{"class":409,"line":489},4,[407,491,492],{"class":421},"}",[407,494,495],{"class":417},")\n",[407,497,499],{"class":409,"line":498},5,[407,500,502],{"class":501},"sHwdD","\u002F\u002F response.customer, response.accessToken, response.refreshToken\n",[388,504,506],{"id":505},"registerparams",[367,507,508],{},"register(params)",[363,510,511],{},"Create a new customer account.",[398,513,515],{"className":400,"code":514,"language":402,"meta":403,"style":403},"await client.auth.register({\n  email: 'new@example.com',\n  password: 'secret',\n  name: 'Anna Svensson',\n})\n",[367,516,517,537,552,566,582],{"__ignoreMap":403},[407,518,519,522,524,526,528,530,533,535],{"class":409,"line":410},[407,520,521],{"class":425},"await",[407,523,429],{"class":417},[407,525,370],{"class":421},[407,527,434],{"class":417},[407,529,370],{"class":421},[407,531,532],{"class":439},"register",[407,534,443],{"class":417},[407,536,446],{"class":421},[407,538,539,541,543,545,548,550],{"class":409,"line":449},[407,540,453],{"class":452},[407,542,456],{"class":421},[407,544,459],{"class":421},[407,546,547],{"class":462},"new@example.com",[407,549,466],{"class":421},[407,551,469],{"class":421},[407,553,554,556,558,560,562,564],{"class":409,"line":472},[407,555,475],{"class":452},[407,557,456],{"class":421},[407,559,459],{"class":421},[407,561,482],{"class":462},[407,563,466],{"class":421},[407,565,469],{"class":421},[407,567,568,571,573,575,578,580],{"class":409,"line":489},[407,569,570],{"class":452},"  name",[407,572,456],{"class":421},[407,574,459],{"class":421},[407,576,577],{"class":462},"Anna Svensson",[407,579,466],{"class":421},[407,581,469],{"class":421},[407,583,584,586],{"class":409,"line":498},[407,585,492],{"class":421},[407,587,495],{"class":417},[388,589,591,594,595,594,598],{"id":590},"sendmagiclinkemail-verifymagiclinktoken-verifymagiclinkcode-email-code",[367,592,593],{},"sendMagicLink(email)"," \u002F ",[367,596,597],{},"verifyMagicLink(token)",[367,599,600],{},"verifyMagicLinkCode({ email, code })",[363,602,603,604,608],{},"Passwordless flow. The email carries ",[605,606,607],"strong",{},"both"," a link and a six-digit code for the same request; the customer uses either one.",[398,610,612],{"className":400,"code":611,"language":402,"meta":403,"style":403},"await client.auth.sendMagicLink('customer@example.com')\n\n\u002F\u002F On the \u002Fauth\u002Fverify?token=\u003Ctoken> landing page, from a click handler:\nconst response = await client.auth.verifyMagicLink(token)\n\n\u002F\u002F Or, in the tab where the link was requested:\nconst response = await client.auth.verifyMagicLinkCode({ email, code })\n",[367,613,614,639,645,650,674,678,684],{"__ignoreMap":403},[407,615,616,618,620,622,624,626,629,631,633,635,637],{"class":409,"line":410},[407,617,521],{"class":425},[407,619,429],{"class":417},[407,621,370],{"class":421},[407,623,434],{"class":417},[407,625,370],{"class":421},[407,627,628],{"class":439},"sendMagicLink",[407,630,443],{"class":417},[407,632,466],{"class":421},[407,634,463],{"class":462},[407,636,466],{"class":421},[407,638,495],{"class":417},[407,640,641],{"class":409,"line":449},[407,642,644],{"emptyLinePlaceholder":643},true,"\n",[407,646,647],{"class":409,"line":472},[407,648,649],{"class":501},"\u002F\u002F On the \u002Fauth\u002Fverify?token=\u003Ctoken> landing page, from a click handler:\n",[407,651,652,654,656,658,660,662,664,666,668,671],{"class":409,"line":489},[407,653,414],{"class":413},[407,655,418],{"class":417},[407,657,422],{"class":421},[407,659,426],{"class":425},[407,661,429],{"class":417},[407,663,370],{"class":421},[407,665,434],{"class":417},[407,667,370],{"class":421},[407,669,670],{"class":439},"verifyMagicLink",[407,672,673],{"class":417},"(token)\n",[407,675,676],{"class":409,"line":498},[407,677,644],{"emptyLinePlaceholder":643},[407,679,681],{"class":409,"line":680},6,[407,682,683],{"class":501},"\u002F\u002F Or, in the tab where the link was requested:\n",[407,685,687,689,691,693,695,697,699,701,703,706,708,711,714,717,720,722],{"class":409,"line":686},7,[407,688,414],{"class":413},[407,690,418],{"class":417},[407,692,422],{"class":421},[407,694,426],{"class":425},[407,696,429],{"class":417},[407,698,370],{"class":421},[407,700,434],{"class":417},[407,702,370],{"class":421},[407,704,705],{"class":439},"verifyMagicLinkCode",[407,707,443],{"class":417},[407,709,710],{"class":421},"{",[407,712,713],{"class":417}," email",[407,715,716],{"class":421},",",[407,718,719],{"class":417}," code ",[407,721,492],{"class":421},[407,723,495],{"class":417},[725,726,728,731,732,734,735,738],"callout",{"color":727},"warning",[605,729,730],{},"Never exchange the token on page load."," Corporate email security (Microsoft Safe Links, Proofpoint) opens links in a headless browser and runs the page's JavaScript. A landing page that calls ",[367,733,670],{}," in ",[367,736,737],{},"onMounted"," hands the one-time session to the scanner and shows the customer \"invalid link\". Render a \"Sign in\" button and verify on click. Scanners render pages; they do not click buttons.",[363,740,741],{},"The code is bound to the email address it was sent to and dies after five wrong attempts. It exists for two cases the link cannot cover: a scanner has already consumed the link, or the customer reads the email on one device and signs in on another. Up to three unused link+code pairs may be outstanding per customer; requesting a new one does not invalidate the previous ones.",[388,743,745],{"id":744},"methods-1",[367,746,747],{},"methods()",[363,749,750,751,754],{},"Which sign-in options the store has turned on under ",[605,752,753],{},"Settings → Customer accounts",". Render your sign-in page from this instead of hard-coding it.",[398,756,758],{"className":400,"code":757,"language":402,"meta":403,"style":403},"const methods = await client.auth.methods()\n\u002F\u002F { password: true, magicLink: true, registration: { b2c: true, b2b: false },\n\u002F\u002F   klarna: { clientId: 'klarna_live_client_…', environment: 'production', scope: 'openid offline_access profile:name profile:email profile:phone' },\n\u002F\u002F   google: { clientId: '…apps.googleusercontent.com', scope: 'openid email profile' },\n\u002F\u002F   microsoft: { clientId: '…', authority: 'https:\u002F\u002Flogin.microsoftonline.com\u002Forganizations\u002Fv2.0', accounts: 'work', scope: 'openid profile email' } }\n",[367,759,760,784,789,794,799],{"__ignoreMap":403},[407,761,762,764,767,769,771,773,775,777,779,781],{"class":409,"line":410},[407,763,414],{"class":413},[407,765,766],{"class":417}," methods ",[407,768,422],{"class":421},[407,770,426],{"class":425},[407,772,429],{"class":417},[407,774,370],{"class":421},[407,776,434],{"class":417},[407,778,370],{"class":421},[407,780,385],{"class":439},[407,782,783],{"class":417},"()\n",[407,785,786],{"class":409,"line":449},[407,787,788],{"class":501},"\u002F\u002F { password: true, magicLink: true, registration: { b2c: true, b2b: false },\n",[407,790,791],{"class":409,"line":472},[407,792,793],{"class":501},"\u002F\u002F   klarna: { clientId: 'klarna_live_client_…', environment: 'production', scope: 'openid offline_access profile:name profile:email profile:phone' },\n",[407,795,796],{"class":409,"line":489},[407,797,798],{"class":501},"\u002F\u002F   google: { clientId: '…apps.googleusercontent.com', scope: 'openid email profile' },\n",[407,800,801],{"class":409,"line":498},[407,802,803],{"class":501},"\u002F\u002F   microsoft: { clientId: '…', authority: 'https:\u002F\u002Flogin.microsoftonline.com\u002Forganizations\u002Fv2.0', accounts: 'work', scope: 'openid profile email' } }\n",[363,805,806,809,810,813,814,817,818,821,822,825,826,829],{},[367,807,808],{},"magicLink"," is always ",[367,811,812],{},"true",": the link confirms the customer's email and is how a customer who forgot their password gets in. ",[367,815,816],{},"password"," is ",[367,819,820],{},"false"," when the store chose ",[605,823,824],{},"Magic link only",". Each provider is ",[367,827,828],{},"null"," unless the store has its integration turned on and the provider chosen under Customer accounts.",[388,831,833],{"id":832},"signinwithproviderprovider-idtoken",[367,834,835],{},"signInWithProvider(provider, { idToken })",[363,837,838,839,841,842,845],{},"Sign in with Klarna, Google or Microsoft. Run the provider's own sign-in with the values from ",[367,840,747],{}," and send the ",[367,843,844],{},"id_token"," it gives you:",[398,847,849],{"className":400,"code":848,"language":402,"meta":403,"style":403},"const { klarna, google, microsoft } = await client.auth.methods()\n\nasync function finish(provider, idToken) {\n  const response = await client.auth.signInWithProvider(provider, { idToken })\n  if (response.outcome === 'pending-approval') return showAwaitingApproval()\n  \u002F\u002F signed-in, linked or created: the client now holds the customer's access token.\n  \u002F\u002F response.company is set when the customer joined their company through its sign-in domain.\n}\n\n\u002F\u002F Klarna — \u003Cscript src=\"https:\u002F\u002Fjs.klarna.com\u002Fweb-sdk\u002Fv1\u002Fklarna.js\" defer>\u003C\u002Fscript>\nif (klarna) {\n  const sdk = await Klarna.init({ clientId: klarna.clientId, environment: klarna.environment })\n  sdk.Identity.button({ id: 'klarna-signin', scope: klarna.scope, redirectUri: `${location.origin}\u002Faccount\u002Fklarna-callback` })\n    .mount('#klarna-signin')\n  sdk.Identity.on('signin', (signin) => finish('klarna', signin.user_account_linking.user_account_linking_id_token))\n}\n\n\u002F\u002F Google — \u003Cscript src=\"https:\u002F\u002Faccounts.google.com\u002Fgsi\u002Fclient\" async>\u003C\u002Fscript>\nif (google) {\n  window.google.accounts.id.initialize({ client_id: google.clientId, callback: ({ credential }) => finish('google', credential) })\n  window.google.accounts.id.renderButton(document.getElementById('google-signin'), { theme: 'outline', size: 'large' })\n}\n\n\u002F\u002F Microsoft — npm i @azure\u002Fmsal-browser\nif (microsoft) {\n  const msal = new PublicClientApplication({ auth: { clientId: microsoft.clientId, authority: microsoft.authority, redirectUri: `${location.origin}\u002Faccount\u002Fsign-in` } })\n  await msal.initialize()\n  const result = await msal.loginPopup({ scopes: microsoft.scope.split(' ') })\n  await finish('microsoft', result.idToken)\n}\n",[367,850,851,890,894,922,960,997,1002,1007,1013,1018,1024,1035,1089,1165,1185,1248,1253,1258,1264,1274,1353,1430,1435,1440,1446,1456,1535,1549,1600,1627],{"__ignoreMap":403},[407,852,853,855,858,861,863,866,868,871,873,876,878,880,882,884,886,888],{"class":409,"line":410},[407,854,414],{"class":413},[407,856,857],{"class":421}," {",[407,859,860],{"class":417}," klarna",[407,862,716],{"class":421},[407,864,865],{"class":417}," google",[407,867,716],{"class":421},[407,869,870],{"class":417}," microsoft ",[407,872,492],{"class":421},[407,874,875],{"class":421}," =",[407,877,426],{"class":425},[407,879,429],{"class":417},[407,881,370],{"class":421},[407,883,434],{"class":417},[407,885,370],{"class":421},[407,887,385],{"class":439},[407,889,783],{"class":417},[407,891,892],{"class":409,"line":449},[407,893,644],{"emptyLinePlaceholder":643},[407,895,896,899,902,905,907,911,913,916,919],{"class":409,"line":472},[407,897,898],{"class":413},"async",[407,900,901],{"class":413}," function",[407,903,904],{"class":439}," finish",[407,906,443],{"class":421},[407,908,910],{"class":909},"sHdIc","provider",[407,912,716],{"class":421},[407,914,915],{"class":909}," idToken",[407,917,918],{"class":421},")",[407,920,921],{"class":421}," {\n",[407,923,924,927,930,932,934,936,938,940,942,945,947,949,951,953,955,958],{"class":409,"line":489},[407,925,926],{"class":413},"  const",[407,928,929],{"class":417}," response",[407,931,875],{"class":421},[407,933,426],{"class":425},[407,935,429],{"class":417},[407,937,370],{"class":421},[407,939,434],{"class":417},[407,941,370],{"class":421},[407,943,944],{"class":439},"signInWithProvider",[407,946,443],{"class":452},[407,948,910],{"class":417},[407,950,716],{"class":421},[407,952,857],{"class":421},[407,954,915],{"class":417},[407,956,957],{"class":421}," }",[407,959,495],{"class":452},[407,961,962,965,968,971,973,976,979,981,984,986,989,992,995],{"class":409,"line":498},[407,963,964],{"class":425},"  if",[407,966,967],{"class":452}," (",[407,969,970],{"class":417},"response",[407,972,370],{"class":421},[407,974,975],{"class":417},"outcome",[407,977,978],{"class":421}," ===",[407,980,459],{"class":421},[407,982,983],{"class":462},"pending-approval",[407,985,466],{"class":421},[407,987,988],{"class":452},") ",[407,990,991],{"class":425},"return",[407,993,994],{"class":439}," showAwaitingApproval",[407,996,783],{"class":452},[407,998,999],{"class":409,"line":680},[407,1000,1001],{"class":501},"  \u002F\u002F signed-in, linked or created: the client now holds the customer's access token.\n",[407,1003,1004],{"class":409,"line":686},[407,1005,1006],{"class":501},"  \u002F\u002F response.company is set when the customer joined their company through its sign-in domain.\n",[407,1008,1010],{"class":409,"line":1009},8,[407,1011,1012],{"class":421},"}\n",[407,1014,1016],{"class":409,"line":1015},9,[407,1017,644],{"emptyLinePlaceholder":643},[407,1019,1021],{"class":409,"line":1020},10,[407,1022,1023],{"class":501},"\u002F\u002F Klarna — \u003Cscript src=\"https:\u002F\u002Fjs.klarna.com\u002Fweb-sdk\u002Fv1\u002Fklarna.js\" defer>\u003C\u002Fscript>\n",[407,1025,1027,1030,1033],{"class":409,"line":1026},11,[407,1028,1029],{"class":425},"if",[407,1031,1032],{"class":417}," (klarna) ",[407,1034,446],{"class":421},[407,1036,1038,1040,1043,1045,1047,1050,1052,1055,1057,1059,1062,1064,1066,1068,1071,1073,1076,1078,1080,1082,1085,1087],{"class":409,"line":1037},12,[407,1039,926],{"class":413},[407,1041,1042],{"class":417}," sdk",[407,1044,875],{"class":421},[407,1046,426],{"class":425},[407,1048,1049],{"class":417}," Klarna",[407,1051,370],{"class":421},[407,1053,1054],{"class":439},"init",[407,1056,443],{"class":452},[407,1058,710],{"class":421},[407,1060,1061],{"class":452}," clientId",[407,1063,456],{"class":421},[407,1065,860],{"class":417},[407,1067,370],{"class":421},[407,1069,1070],{"class":417},"clientId",[407,1072,716],{"class":421},[407,1074,1075],{"class":452}," environment",[407,1077,456],{"class":421},[407,1079,860],{"class":417},[407,1081,370],{"class":421},[407,1083,1084],{"class":417},"environment",[407,1086,957],{"class":421},[407,1088,495],{"class":452},[407,1090,1092,1095,1097,1100,1102,1105,1107,1109,1112,1114,1116,1119,1121,1123,1126,1128,1130,1132,1135,1137,1140,1142,1145,1148,1150,1153,1155,1158,1161,1163],{"class":409,"line":1091},13,[407,1093,1094],{"class":417},"  sdk",[407,1096,370],{"class":421},[407,1098,1099],{"class":417},"Identity",[407,1101,370],{"class":421},[407,1103,1104],{"class":439},"button",[407,1106,443],{"class":452},[407,1108,710],{"class":421},[407,1110,1111],{"class":452}," id",[407,1113,456],{"class":421},[407,1115,459],{"class":421},[407,1117,1118],{"class":462},"klarna-signin",[407,1120,466],{"class":421},[407,1122,716],{"class":421},[407,1124,1125],{"class":452}," scope",[407,1127,456],{"class":421},[407,1129,860],{"class":417},[407,1131,370],{"class":421},[407,1133,1134],{"class":417},"scope",[407,1136,716],{"class":421},[407,1138,1139],{"class":452}," redirectUri",[407,1141,456],{"class":421},[407,1143,1144],{"class":421}," `${",[407,1146,1147],{"class":417},"location",[407,1149,370],{"class":421},[407,1151,1152],{"class":417},"origin",[407,1154,492],{"class":421},[407,1156,1157],{"class":462},"\u002Faccount\u002Fklarna-callback",[407,1159,1160],{"class":421},"`",[407,1162,957],{"class":421},[407,1164,495],{"class":452},[407,1166,1168,1171,1174,1176,1178,1181,1183],{"class":409,"line":1167},14,[407,1169,1170],{"class":421},"    .",[407,1172,1173],{"class":439},"mount",[407,1175,443],{"class":452},[407,1177,466],{"class":421},[407,1179,1180],{"class":462},"#klarna-signin",[407,1182,466],{"class":421},[407,1184,495],{"class":452},[407,1186,1188,1190,1192,1194,1196,1199,1201,1203,1206,1208,1210,1212,1214,1216,1219,1221,1223,1225,1228,1230,1232,1235,1237,1240,1242,1245],{"class":409,"line":1187},15,[407,1189,1094],{"class":417},[407,1191,370],{"class":421},[407,1193,1099],{"class":417},[407,1195,370],{"class":421},[407,1197,1198],{"class":439},"on",[407,1200,443],{"class":452},[407,1202,466],{"class":421},[407,1204,1205],{"class":462},"signin",[407,1207,466],{"class":421},[407,1209,716],{"class":421},[407,1211,967],{"class":421},[407,1213,1205],{"class":909},[407,1215,918],{"class":421},[407,1217,1218],{"class":413}," =>",[407,1220,904],{"class":439},[407,1222,443],{"class":452},[407,1224,466],{"class":421},[407,1226,1227],{"class":462},"klarna",[407,1229,466],{"class":421},[407,1231,716],{"class":421},[407,1233,1234],{"class":417}," signin",[407,1236,370],{"class":421},[407,1238,1239],{"class":417},"user_account_linking",[407,1241,370],{"class":421},[407,1243,1244],{"class":417},"user_account_linking_id_token",[407,1246,1247],{"class":452},"))\n",[407,1249,1251],{"class":409,"line":1250},16,[407,1252,1012],{"class":421},[407,1254,1256],{"class":409,"line":1255},17,[407,1257,644],{"emptyLinePlaceholder":643},[407,1259,1261],{"class":409,"line":1260},18,[407,1262,1263],{"class":501},"\u002F\u002F Google — \u003Cscript src=\"https:\u002F\u002Faccounts.google.com\u002Fgsi\u002Fclient\" async>\u003C\u002Fscript>\n",[407,1265,1267,1269,1272],{"class":409,"line":1266},19,[407,1268,1029],{"class":425},[407,1270,1271],{"class":417}," (google) ",[407,1273,446],{"class":421},[407,1275,1277,1280,1282,1285,1287,1290,1292,1295,1297,1300,1302,1304,1307,1309,1311,1313,1315,1317,1320,1322,1325,1328,1331,1333,1335,1337,1339,1341,1343,1345,1347,1349,1351],{"class":409,"line":1276},20,[407,1278,1279],{"class":417},"  window",[407,1281,370],{"class":421},[407,1283,1284],{"class":417},"google",[407,1286,370],{"class":421},[407,1288,1289],{"class":417},"accounts",[407,1291,370],{"class":421},[407,1293,1294],{"class":417},"id",[407,1296,370],{"class":421},[407,1298,1299],{"class":439},"initialize",[407,1301,443],{"class":452},[407,1303,710],{"class":421},[407,1305,1306],{"class":452}," client_id",[407,1308,456],{"class":421},[407,1310,865],{"class":417},[407,1312,370],{"class":421},[407,1314,1070],{"class":417},[407,1316,716],{"class":421},[407,1318,1319],{"class":439}," callback",[407,1321,456],{"class":421},[407,1323,1324],{"class":421}," ({",[407,1326,1327],{"class":909}," credential",[407,1329,1330],{"class":421}," })",[407,1332,1218],{"class":413},[407,1334,904],{"class":439},[407,1336,443],{"class":452},[407,1338,466],{"class":421},[407,1340,1284],{"class":462},[407,1342,466],{"class":421},[407,1344,716],{"class":421},[407,1346,1327],{"class":417},[407,1348,988],{"class":452},[407,1350,492],{"class":421},[407,1352,495],{"class":452},[407,1354,1356,1358,1360,1362,1364,1366,1368,1370,1372,1375,1377,1380,1382,1385,1387,1389,1392,1394,1396,1398,1400,1403,1405,1407,1410,1412,1414,1417,1419,1421,1424,1426,1428],{"class":409,"line":1355},21,[407,1357,1279],{"class":417},[407,1359,370],{"class":421},[407,1361,1284],{"class":417},[407,1363,370],{"class":421},[407,1365,1289],{"class":417},[407,1367,370],{"class":421},[407,1369,1294],{"class":417},[407,1371,370],{"class":421},[407,1373,1374],{"class":439},"renderButton",[407,1376,443],{"class":452},[407,1378,1379],{"class":417},"document",[407,1381,370],{"class":421},[407,1383,1384],{"class":439},"getElementById",[407,1386,443],{"class":452},[407,1388,466],{"class":421},[407,1390,1391],{"class":462},"google-signin",[407,1393,466],{"class":421},[407,1395,918],{"class":452},[407,1397,716],{"class":421},[407,1399,857],{"class":421},[407,1401,1402],{"class":452}," theme",[407,1404,456],{"class":421},[407,1406,459],{"class":421},[407,1408,1409],{"class":462},"outline",[407,1411,466],{"class":421},[407,1413,716],{"class":421},[407,1415,1416],{"class":452}," size",[407,1418,456],{"class":421},[407,1420,459],{"class":421},[407,1422,1423],{"class":462},"large",[407,1425,466],{"class":421},[407,1427,957],{"class":421},[407,1429,495],{"class":452},[407,1431,1433],{"class":409,"line":1432},22,[407,1434,1012],{"class":421},[407,1436,1438],{"class":409,"line":1437},23,[407,1439,644],{"emptyLinePlaceholder":643},[407,1441,1443],{"class":409,"line":1442},24,[407,1444,1445],{"class":501},"\u002F\u002F Microsoft — npm i @azure\u002Fmsal-browser\n",[407,1447,1449,1451,1454],{"class":409,"line":1448},25,[407,1450,1029],{"class":425},[407,1452,1453],{"class":417}," (microsoft) ",[407,1455,446],{"class":421},[407,1457,1459,1461,1464,1466,1469,1472,1474,1476,1479,1481,1483,1485,1487,1490,1492,1494,1496,1499,1501,1503,1505,1508,1510,1512,1514,1516,1518,1520,1522,1524,1527,1529,1531,1533],{"class":409,"line":1458},26,[407,1460,926],{"class":413},[407,1462,1463],{"class":417}," msal",[407,1465,875],{"class":421},[407,1467,1468],{"class":421}," new",[407,1470,1471],{"class":439}," PublicClientApplication",[407,1473,443],{"class":452},[407,1475,710],{"class":421},[407,1477,1478],{"class":452}," auth",[407,1480,456],{"class":421},[407,1482,857],{"class":421},[407,1484,1061],{"class":452},[407,1486,456],{"class":421},[407,1488,1489],{"class":417}," microsoft",[407,1491,370],{"class":421},[407,1493,1070],{"class":417},[407,1495,716],{"class":421},[407,1497,1498],{"class":452}," authority",[407,1500,456],{"class":421},[407,1502,1489],{"class":417},[407,1504,370],{"class":421},[407,1506,1507],{"class":417},"authority",[407,1509,716],{"class":421},[407,1511,1139],{"class":452},[407,1513,456],{"class":421},[407,1515,1144],{"class":421},[407,1517,1147],{"class":417},[407,1519,370],{"class":421},[407,1521,1152],{"class":417},[407,1523,492],{"class":421},[407,1525,1526],{"class":462},"\u002Faccount\u002Fsign-in",[407,1528,1160],{"class":421},[407,1530,957],{"class":421},[407,1532,957],{"class":421},[407,1534,495],{"class":452},[407,1536,1538,1541,1543,1545,1547],{"class":409,"line":1537},27,[407,1539,1540],{"class":425},"  await",[407,1542,1463],{"class":417},[407,1544,370],{"class":421},[407,1546,1299],{"class":439},[407,1548,783],{"class":452},[407,1550,1552,1554,1557,1559,1561,1563,1565,1568,1570,1572,1575,1577,1579,1581,1583,1585,1588,1590,1592,1594,1596,1598],{"class":409,"line":1551},28,[407,1553,926],{"class":413},[407,1555,1556],{"class":417}," result",[407,1558,875],{"class":421},[407,1560,426],{"class":425},[407,1562,1463],{"class":417},[407,1564,370],{"class":421},[407,1566,1567],{"class":439},"loginPopup",[407,1569,443],{"class":452},[407,1571,710],{"class":421},[407,1573,1574],{"class":452}," scopes",[407,1576,456],{"class":421},[407,1578,1489],{"class":417},[407,1580,370],{"class":421},[407,1582,1134],{"class":417},[407,1584,370],{"class":421},[407,1586,1587],{"class":439},"split",[407,1589,443],{"class":452},[407,1591,466],{"class":421},[407,1593,459],{"class":421},[407,1595,988],{"class":452},[407,1597,492],{"class":421},[407,1599,495],{"class":452},[407,1601,1603,1605,1607,1609,1611,1614,1616,1618,1620,1622,1625],{"class":409,"line":1602},29,[407,1604,1540],{"class":425},[407,1606,904],{"class":439},[407,1608,443],{"class":452},[407,1610,466],{"class":421},[407,1612,1613],{"class":462},"microsoft",[407,1615,466],{"class":421},[407,1617,716],{"class":421},[407,1619,1556],{"class":417},[407,1621,370],{"class":421},[407,1623,1624],{"class":417},"idToken",[407,1626,495],{"class":452},[407,1628,1630],{"class":409,"line":1629},30,[407,1631,1012],{"class":421},[363,1633,1634,1635,1638,1639,1642],{},"Register the redirect and origin addresses with each provider: Klarna's portal (the callback page is required, since browsers can block Klarna's popup and the flow then continues there), ",[605,1636,1637],{},"Authorized JavaScript origins"," on the Google OAuth client, and a ",[605,1640,1641],{},"Single-page application"," redirect URI on the Microsoft app registration.",[363,1644,1645],{},"The API verifies the token against the provider's keys and the store's client id, then:",[1647,1648,1649,1656,1669],"ul",{},[1650,1651,1652,1655],"li",{},[605,1653,1654],{},"A linked customer"," is signed in.",[1650,1657,1658,1661,1662,1665,1666,370],{},[605,1659,1660],{},"A customer with the same email"," is linked, but only when the provider confirms the address. Klarna and Google do; Microsoft does not, because an organization's administrator can give any address to a work account. Without confirmation the API answers ",[367,1663,1664],{},"409 IDENTITY_EMAIL_NOT_VERIFIED",": let the customer sign in with email, then call ",[367,1667,1668],{},"linkProvider",[1650,1670,1671,1674,1675,1678,1679,1681],{},[605,1672,1673],{},"Otherwise a customer is created."," A Microsoft or Google Workspace sign-in from an organization whose domain is on a company (company sign-in domains, with ",[605,1676,1677],{},"Companies via sign-in"," on) creates a company contact and makes it a member, even when registration is closed. Anyone else becomes a private customer when registration is open, with manual approval as for ",[367,1680,532],{}," (HTTP 202, no tokens).",[363,1683,1684],{},"Existing customers join their company the same way the next time they sign in.",[388,1686,1688,594,1691],{"id":1687},"linkproviderprovider-idtoken-unlinkproviderprovider",[367,1689,1690],{},"linkProvider(provider, { idToken })",[367,1692,1693],{},"unlinkProvider(provider)",[363,1695,1696,1697,1700,1701,1704,1705,370],{},"Connect or disconnect a provider on the signed-in customer's account, for example from ",[605,1698,1699],{},"My account",". Linking from a signed-in session is how a Microsoft user with an existing account connects Microsoft. ",[367,1702,1703],{},"getMe()"," lists the connected providers in ",[367,1706,1707],{},"identities",[398,1709,1711],{"className":400,"code":1710,"language":402,"meta":403,"style":403},"await client.auth.linkProvider('microsoft', { idToken })   \u002F\u002F 409 IDENTITY_ALREADY_LINKED if another customer has it\nawait client.auth.unlinkProvider('microsoft')\n",[367,1712,1713,1750],{"__ignoreMap":403},[407,1714,1715,1717,1719,1721,1723,1725,1727,1729,1731,1733,1735,1737,1739,1742,1744,1747],{"class":409,"line":410},[407,1716,521],{"class":425},[407,1718,429],{"class":417},[407,1720,370],{"class":421},[407,1722,434],{"class":417},[407,1724,370],{"class":421},[407,1726,1668],{"class":439},[407,1728,443],{"class":417},[407,1730,466],{"class":421},[407,1732,1613],{"class":462},[407,1734,466],{"class":421},[407,1736,716],{"class":421},[407,1738,857],{"class":421},[407,1740,1741],{"class":417}," idToken ",[407,1743,492],{"class":421},[407,1745,1746],{"class":417},")   ",[407,1748,1749],{"class":501},"\u002F\u002F 409 IDENTITY_ALREADY_LINKED if another customer has it\n",[407,1751,1752,1754,1756,1758,1760,1762,1765,1767,1769,1771,1773],{"class":409,"line":449},[407,1753,521],{"class":425},[407,1755,429],{"class":417},[407,1757,370],{"class":421},[407,1759,434],{"class":417},[407,1761,370],{"class":421},[407,1763,1764],{"class":439},"unlinkProvider",[407,1766,443],{"class":417},[407,1768,466],{"class":421},[407,1770,1613],{"class":462},[407,1772,466],{"class":421},[407,1774,495],{"class":417},[388,1776,1778],{"id":1777},"refreshrefreshtoken",[367,1779,1780],{},"refresh(refreshToken)",[363,1782,1783],{},"Refresh the access token using a stored refresh token.",[398,1785,1787],{"className":400,"code":1786,"language":402,"meta":403,"style":403},"const { accessToken } = await client.auth.refresh(storedRefreshToken)\n",[367,1788,1789],{"__ignoreMap":403},[407,1790,1791,1793,1795,1798,1800,1802,1804,1806,1808,1810,1812,1815],{"class":409,"line":410},[407,1792,414],{"class":413},[407,1794,857],{"class":421},[407,1796,1797],{"class":417}," accessToken ",[407,1799,492],{"class":421},[407,1801,875],{"class":421},[407,1803,426],{"class":425},[407,1805,429],{"class":417},[407,1807,370],{"class":421},[407,1809,434],{"class":417},[407,1811,370],{"class":421},[407,1813,1814],{"class":439},"refresh",[407,1816,1817],{"class":417},"(storedRefreshToken)\n",[388,1819,1821],{"id":1820},"logout",[367,1822,1823],{},"logout()",[398,1825,1827],{"className":400,"code":1826,"language":402,"meta":403,"style":403},"await client.auth.logout()\n",[367,1828,1829],{"__ignoreMap":403},[407,1830,1831,1833,1835,1837,1839,1841,1843],{"class":409,"line":410},[407,1832,521],{"class":425},[407,1834,429],{"class":417},[407,1836,370],{"class":421},[407,1838,434],{"class":417},[407,1840,370],{"class":421},[407,1842,1820],{"class":439},[407,1844,783],{"class":417},[388,1846,1848,594,1851],{"id":1847},"getprofile-updateprofileparams",[367,1849,1850],{},"getProfile()",[367,1852,1853],{},"updateProfile(params)",[398,1855,1857],{"className":400,"code":1856,"language":402,"meta":403,"style":403},"const profile = await client.auth.getProfile()\n\nawait client.auth.updateProfile({\n  name: 'Anna L Svensson',\n  phone: '+46701234567',\n})\n",[367,1858,1859,1883,1887,1906,1921,1937],{"__ignoreMap":403},[407,1860,1861,1863,1866,1868,1870,1872,1874,1876,1878,1881],{"class":409,"line":410},[407,1862,414],{"class":413},[407,1864,1865],{"class":417}," profile ",[407,1867,422],{"class":421},[407,1869,426],{"class":425},[407,1871,429],{"class":417},[407,1873,370],{"class":421},[407,1875,434],{"class":417},[407,1877,370],{"class":421},[407,1879,1880],{"class":439},"getProfile",[407,1882,783],{"class":417},[407,1884,1885],{"class":409,"line":449},[407,1886,644],{"emptyLinePlaceholder":643},[407,1888,1889,1891,1893,1895,1897,1899,1902,1904],{"class":409,"line":472},[407,1890,521],{"class":425},[407,1892,429],{"class":417},[407,1894,370],{"class":421},[407,1896,434],{"class":417},[407,1898,370],{"class":421},[407,1900,1901],{"class":439},"updateProfile",[407,1903,443],{"class":417},[407,1905,446],{"class":421},[407,1907,1908,1910,1912,1914,1917,1919],{"class":409,"line":489},[407,1909,570],{"class":452},[407,1911,456],{"class":421},[407,1913,459],{"class":421},[407,1915,1916],{"class":462},"Anna L Svensson",[407,1918,466],{"class":421},[407,1920,469],{"class":421},[407,1922,1923,1926,1928,1930,1933,1935],{"class":409,"line":498},[407,1924,1925],{"class":452},"  phone",[407,1927,456],{"class":421},[407,1929,459],{"class":421},[407,1931,1932],{"class":462},"+46701234567",[407,1934,466],{"class":421},[407,1936,469],{"class":421},[407,1938,1939,1941],{"class":409,"line":680},[407,1940,492],{"class":421},[407,1942,495],{"class":417},[383,1944,1946],{"id":1945},"key-types","Key types",[398,1948,1950],{"className":400,"code":1949,"language":402,"meta":403,"style":403},"interface AuthResponse {\n  accessToken: string\n  refreshToken: string\n  customer: CustomerProfile\n}\n\ninterface CustomerProfile {\n  id: string\n  email: string\n  name: string\n  phone?: string\n}\n",[367,1951,1952,1963,1973,1982,1992,1996,2000,2009,2018,2026,2034,2043],{"__ignoreMap":403},[407,1953,1954,1957,1961],{"class":409,"line":410},[407,1955,1956],{"class":413},"interface",[407,1958,1960],{"class":1959},"sBMFI"," AuthResponse",[407,1962,921],{"class":421},[407,1964,1965,1968,1970],{"class":409,"line":449},[407,1966,1967],{"class":452},"  accessToken",[407,1969,456],{"class":421},[407,1971,1972],{"class":1959}," string\n",[407,1974,1975,1978,1980],{"class":409,"line":472},[407,1976,1977],{"class":452},"  refreshToken",[407,1979,456],{"class":421},[407,1981,1972],{"class":1959},[407,1983,1984,1987,1989],{"class":409,"line":489},[407,1985,1986],{"class":452},"  customer",[407,1988,456],{"class":421},[407,1990,1991],{"class":1959}," CustomerProfile\n",[407,1993,1994],{"class":409,"line":498},[407,1995,1012],{"class":421},[407,1997,1998],{"class":409,"line":680},[407,1999,644],{"emptyLinePlaceholder":643},[407,2001,2002,2004,2007],{"class":409,"line":686},[407,2003,1956],{"class":413},[407,2005,2006],{"class":1959}," CustomerProfile",[407,2008,921],{"class":421},[407,2010,2011,2014,2016],{"class":409,"line":1009},[407,2012,2013],{"class":452},"  id",[407,2015,456],{"class":421},[407,2017,1972],{"class":1959},[407,2019,2020,2022,2024],{"class":409,"line":1015},[407,2021,453],{"class":452},[407,2023,456],{"class":421},[407,2025,1972],{"class":1959},[407,2027,2028,2030,2032],{"class":409,"line":1020},[407,2029,570],{"class":452},[407,2031,456],{"class":421},[407,2033,1972],{"class":1959},[407,2035,2036,2038,2041],{"class":409,"line":1026},[407,2037,1925],{"class":452},[407,2039,2040],{"class":421},"?:",[407,2042,1972],{"class":1959},[407,2044,2045],{"class":409,"line":1037},[407,2046,1012],{"class":421},[2048,2049,2050],"style",{},"html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}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 .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 .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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 .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 .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":403,"searchDepth":449,"depth":449,"links":2052},[2053,2067],{"id":385,"depth":449,"text":386,"children":2054},[2055,2056,2057,2059,2060,2061,2063,2064,2065],{"id":390,"depth":472,"text":393},{"id":505,"depth":472,"text":508},{"id":590,"depth":472,"text":2058},"sendMagicLink(email) \u002F verifyMagicLink(token) \u002F verifyMagicLinkCode({ email, code })",{"id":744,"depth":472,"text":747},{"id":832,"depth":472,"text":835},{"id":1687,"depth":472,"text":2062},"linkProvider(provider, { idToken }) \u002F unlinkProvider(provider)",{"id":1777,"depth":472,"text":1780},{"id":1820,"depth":472,"text":1823},{"id":1847,"depth":472,"text":2066},"getProfile() \u002F updateProfile(params)",{"id":1945,"depth":449,"text":1946},"Customer login, registration, magic links, and session management","md",null,{"questions":2072},{"en":2073},[2074,2075,2076,2077],"How do I log a customer in with email and password?","Why should I not verify the magic link on page load?","How do I sign in with the six-digit code instead of the link?","How do I refresh an expired access token?",{"title":304,"description":2068},"w4xdXwGdzjA59Z5jbe00RD6ZtdaMvssUM4dymSo6QT4",[2081,2083],{"title":300,"path":301,"stem":302,"description":2082,"children":-1},"Shopping cart lifecycle — create, mutate, and hand off to checkout",{"title":308,"path":309,"stem":310,"description":2084,"children":-1},"Payment session initialization and shipping option resolution",1793388940798]