[{"data":1,"prerenderedAt":1020},["ShallowReactive",2],{"navigation_docs":3,"-docs-cms-delivery-preview":357,"-docs-cms-delivery-preview-surround":1015,"docs-site-config":1004},[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":115,"body":359,"description":1002,"extension":1003,"links":1004,"meta":1005,"navigation":1012,"path":116,"seo":1013,"stem":117,"__hash__":1014},"docs\u002Fdocs\u002Fcms\u002F3.delivery\u002F2.preview.md",{"type":360,"value":361,"toc":993},"minimark",[362,366,383,390,395,410,420,427,486,567,578,596,600,613,618,624,630,634,637,665,675,679,685,735,789,799,803,827,979,989],[363,364,365],"p",{},"Editors preview and edit on your real site, so a draft looks exactly like the published page. There are two levels:",[367,368,369,377],"ul",{},[370,371,372,376],"li",{},[373,374,375],"strong",{},"Preview:"," the editor opens your site with a token, and your site renders the draft.",[370,378,379,382],{},[373,380,381],{},"Live editing:"," the editor shows your site in an iframe, sends every keystroke as an updated document, and lets editors click blocks on the page to edit them.",[363,384,385,389],{},[386,387,388],"code",{},"@avvyr\u002Fcms-nuxt"," has both built in. On other frameworks you implement the parts below.",[391,392,394],"h2",{"id":393},"preview","Preview",[363,396,397,398,401,402,405,406,409],{},"Set the site's ",[373,399,400],{},"preview URL"," in the app (site settings) or with ",[386,403,404],{},"previewUrl"," on ",[386,407,408],{},"PATCH \u002Fv1\u002Fcms\u002Fsites\u002F{siteId}",". Usually it is the site's root URL. When an editor clicks preview, the editor opens:",[411,412,417],"pre",{"className":413,"code":415,"language":416},[414],"language-text","{previewUrl}?entryId={entryId}&path=%2Fom-oss&locale=sv&token={token}\n","text",[386,418,415],{"__ignoreMap":419},"",[363,421,422,423,426],{},"On your server, read the draft with the ",[373,424,425],{},"preview key"," and pass the token on:",[411,428,432],{"className":429,"code":430,"language":431,"meta":419,"style":419},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl \"https:\u002F\u002Fapi.avvyr.com\u002Fv1\u002Fcontent\u002F{siteId}\u002Fdraft\u002Fsv\u002Fpages\u002Fom-oss\" \\\n  -H \"x-cms-key: cms_prv_…\" \\\n  -H \"x-cms-preview-token: {token}\"\n","bash",[386,433,434,458,473],{"__ignoreMap":419},[435,436,439,443,447,451,454],"span",{"class":437,"line":438},"line",1,[435,440,442],{"class":441},"sBMFI","curl",[435,444,446],{"class":445},"sMK4o"," \"",[435,448,450],{"class":449},"sfazB","https:\u002F\u002Fapi.avvyr.com\u002Fv1\u002Fcontent\u002F{siteId}\u002Fdraft\u002Fsv\u002Fpages\u002Fom-oss",[435,452,453],{"class":445},"\"",[435,455,457],{"class":456},"sTEyZ"," \\\n",[435,459,461,464,466,469,471],{"class":437,"line":460},2,[435,462,463],{"class":449},"  -H",[435,465,446],{"class":445},[435,467,468],{"class":449},"x-cms-key: cms_prv_…",[435,470,453],{"class":445},[435,472,457],{"class":456},[435,474,476,478,480,483],{"class":437,"line":475},3,[435,477,463],{"class":449},[435,479,446],{"class":445},[435,481,482],{"class":449},"x-cms-preview-token: {token}",[435,484,485],{"class":445},"\"\n",[411,487,491],{"className":488,"code":489,"language":490,"meta":419,"style":419},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","const page = await cms.draftPage('\u002Fom-oss', { locale: 'sv', previewToken: token })\n","ts",[386,492,493],{"__ignoreMap":419},[435,494,495,499,502,505,509,512,515,519,522,525,528,530,533,536,540,543,546,549,551,553,556,558,561,564],{"class":437,"line":438},[435,496,498],{"class":497},"spNyl","const",[435,500,501],{"class":456}," page ",[435,503,504],{"class":445},"=",[435,506,508],{"class":507},"s7zQu"," await",[435,510,511],{"class":456}," cms",[435,513,514],{"class":445},".",[435,516,518],{"class":517},"s2Zo4","draftPage",[435,520,521],{"class":456},"(",[435,523,524],{"class":445},"'",[435,526,527],{"class":449},"\u002Fom-oss",[435,529,524],{"class":445},[435,531,532],{"class":445},",",[435,534,535],{"class":445}," {",[435,537,539],{"class":538},"swJcz"," locale",[435,541,542],{"class":445},":",[435,544,545],{"class":445}," '",[435,547,548],{"class":449},"sv",[435,550,524],{"class":445},[435,552,532],{"class":445},[435,554,555],{"class":538}," previewToken",[435,557,542],{"class":445},[435,559,560],{"class":456}," token ",[435,562,563],{"class":445},"}",[435,565,566],{"class":456},")\n",[363,568,569,570,573,574,577],{},"Draft routes return the same document as the published routes, with ",[386,571,572],{},"draft: true"," and ",[386,575,576],{},"Cache-Control: private, no-store",". References resolve against draft paths.",[367,579,580,583,589],{},[370,581,582],{},"Never cache draft responses, and never send the preview key to the browser.",[370,584,585,586,514],{},"Mark preview pages ",[386,587,588],{},"noindex",[370,590,591,592,595],{},"A token is valid for one hour. After that the draft routes return ",[386,593,594],{},"401 CMS_PREVIEW_TOKEN_INVALID","; the editor makes a new one each time.",[391,597,599],{"id":598},"live-editing","Live editing",[363,601,602,603,573,606,609,610,514],{},"The editor in the Avvyr app loads your preview URL in an iframe with two extra parameters, ",[386,604,605],{},"cmsEditor=1",[386,607,608],{},"cmsOrigin={editor origin}",", and talks to the page with ",[386,611,612],{},"postMessage",[614,615,617],"h3",{"id":616},"let-the-app-frame-your-site","Let the app frame your site",[363,619,620,621,542],{},"Send this header on HTML responses, and no ",[386,622,623],{},"X-Frame-Options: DENY",[411,625,628],{"className":626,"code":627,"language":416},[414],"Content-Security-Policy: frame-ancestors 'self' https:\u002F\u002Fapp.avvyr.com\n",[386,629,627],{"__ignoreMap":419},[614,631,633],{"id":632},"start-the-bridge-only-when-it-is-safe","Start the bridge only when it is safe",[363,635,636],{},"Start listening only when all of these hold:",[367,638,639,648,655],{},[370,640,641,642,573,645,647],{},"the URL has ",[386,643,644],{},"token",[386,646,605],{},";",[370,649,650,651,654],{},"the page is framed (",[386,652,653],{},"window.parent !== window",");",[370,656,657,660,661,664],{},[386,658,659],{},"cmsOrigin"," is on your own allow-list (default ",[386,662,663],{},"https:\u002F\u002Fapp.avvyr.com",").",[363,666,667,668,671,672,514],{},"Then accept messages only from ",[386,669,670],{},"window.parent"," with that exact origin, and only with the envelope ",[386,673,674],{},"{ source: \"avvyr-cms\", v: 1 }",[614,676,678],{"id":677},"messages","Messages",[363,680,681,682,514],{},"Every message is ",[386,683,684],{},"{ source: \"avvyr-cms\", v: 1, type, ...payload }",[686,687,688,701],"table",{},[689,690,691],"thead",{},[692,693,694,698],"tr",{},[695,696,697],"th",{},"From the editor",[695,699,700],{},"What your site does",[702,703,704,715,725],"tbody",{},[692,705,706,712],{},[707,708,709],"td",{},[386,710,711],{},"update { document }",[707,713,714],{},"Replace the rendered document in place, without reloading. Sent about every 250 ms while someone types.",[692,716,717,722],{},[707,718,719],{},[386,720,721],{},"highlight { blockId | null }",[707,723,724],{},"Outline that block and scroll it into view.",[692,726,727,732],{},[707,728,729],{},[386,730,731],{},"reload",[707,733,734],{},"Reload the page.",[686,736,737,747],{},[689,738,739],{},[692,740,741,744],{},[695,742,743],{},"To the editor",[695,745,746],{},"When",[702,748,749,759,769,779],{},[692,750,751,756],{},[707,752,753],{},[386,754,755],{},"ready { path, locale, entryId? }",[707,757,758],{},"After the page has mounted, and after every route change",[692,760,761,766],{},[707,762,763],{},[386,764,765],{},"hover { blockId | null }",[707,767,768],{},"The pointer moves onto another block",[692,770,771,776],{},[707,772,773],{},[386,774,775],{},"select { blockId }",[707,777,778],{},"A block is clicked. Stop the click there, so links and buttons inside it do nothing.",[692,780,781,786],{},[707,782,783],{},[386,784,785],{},"navigate { path }",[707,787,788],{},"An internal link is clicked. Do not navigate; the editor opens that page.",[363,790,791,792,573,795,798],{},"To find blocks, wrap each rendered block in an element with ",[386,793,794],{},"data-cms-block=\"{block id}\"",[386,796,797],{},"data-cms-type=\"{block type}\"",". With nested blocks, the innermost one wins.",[391,800,802],{"id":801},"in-nuxt","In Nuxt",[363,804,805,807,808,811,812,815,816,818,819,822,823,826],{},[386,806,388],{}," does all of this. While ",[386,809,810],{},"?token="," is in the URL, ",[386,813,814],{},"useCmsPage"," loads the draft through the server and adds ",[386,817,588],{},". The live editing bridge starts on its own under the conditions above, and ",[386,820,821],{},"\u003CCmsBlocks>"," renders the ",[386,824,825],{},"data-cms-block"," wrappers. Configure which editors may frame the site:",[411,828,830],{"className":488,"code":829,"language":490,"meta":419,"style":419},"\u002F\u002F nuxt.config.ts\nexport default defineNuxtConfig({\n  extends: ['@avvyr\u002Fcms-nuxt'],\n  cms: {\n    editorOrigins: ['https:\u002F\u002Fapp.avvyr.com'],\n  },\n  routeRules: {\n    '\u002F**': { headers: { 'Content-Security-Policy': \"frame-ancestors 'self' https:\u002F\u002Fapp.avvyr.com\" } },\n  },\n})\n",[386,831,832,838,854,876,887,907,913,923,967,972],{"__ignoreMap":419},[435,833,834],{"class":437,"line":438},[435,835,837],{"class":836},"sHwdD","\u002F\u002F nuxt.config.ts\n",[435,839,840,843,846,849,851],{"class":437,"line":460},[435,841,842],{"class":507},"export",[435,844,845],{"class":507}," default",[435,847,848],{"class":517}," defineNuxtConfig",[435,850,521],{"class":456},[435,852,853],{"class":445},"{\n",[435,855,856,859,861,864,866,868,870,873],{"class":437,"line":475},[435,857,858],{"class":538},"  extends",[435,860,542],{"class":445},[435,862,863],{"class":456}," [",[435,865,524],{"class":445},[435,867,388],{"class":449},[435,869,524],{"class":445},[435,871,872],{"class":456},"]",[435,874,875],{"class":445},",\n",[435,877,879,882,884],{"class":437,"line":878},4,[435,880,881],{"class":538},"  cms",[435,883,542],{"class":445},[435,885,886],{"class":445}," {\n",[435,888,890,893,895,897,899,901,903,905],{"class":437,"line":889},5,[435,891,892],{"class":538},"    editorOrigins",[435,894,542],{"class":445},[435,896,863],{"class":456},[435,898,524],{"class":445},[435,900,663],{"class":449},[435,902,524],{"class":445},[435,904,872],{"class":456},[435,906,875],{"class":445},[435,908,910],{"class":437,"line":909},6,[435,911,912],{"class":445},"  },\n",[435,914,916,919,921],{"class":437,"line":915},7,[435,917,918],{"class":538},"  routeRules",[435,920,542],{"class":445},[435,922,886],{"class":445},[435,924,926,929,932,934,936,938,941,943,945,947,950,952,954,956,959,961,964],{"class":437,"line":925},8,[435,927,928],{"class":445},"    '",[435,930,931],{"class":538},"\u002F**",[435,933,524],{"class":445},[435,935,542],{"class":445},[435,937,535],{"class":445},[435,939,940],{"class":538}," headers",[435,942,542],{"class":445},[435,944,535],{"class":445},[435,946,545],{"class":445},[435,948,949],{"class":538},"Content-Security-Policy",[435,951,524],{"class":445},[435,953,542],{"class":445},[435,955,446],{"class":445},[435,957,958],{"class":449},"frame-ancestors 'self' https:\u002F\u002Fapp.avvyr.com",[435,960,453],{"class":445},[435,962,963],{"class":445}," }",[435,965,966],{"class":445}," },\n",[435,968,970],{"class":437,"line":969},9,[435,971,912],{"class":445},[435,973,975,977],{"class":437,"line":974},10,[435,976,563],{"class":445},[435,978,566],{"class":456},[363,980,981,982,985,986,514],{},"Setting ",[386,983,984],{},"editorOrigins"," replaces the default, so list every origin you edit from. See ",[987,988,128],"a",{"href":129},[990,991,992],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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 .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}",{"title":419,"searchDepth":460,"depth":460,"links":994},[995,996,1001],{"id":393,"depth":460,"text":394},{"id":598,"depth":460,"text":599,"children":997},[998,999,1000],{"id":616,"depth":475,"text":617},{"id":632,"depth":475,"text":633},{"id":677,"depth":475,"text":678},{"id":801,"depth":460,"text":802},"Show drafts on your own site, and let the Avvyr editor edit your pages live in an iframe","md",null,{"questions":1006},{"en":1007},[1008,1009,1010,1011],"How do I show a draft on my site?","Which URL does the editor open for preview?","Why does the live preview not load in the editor?","Which messages does the live preview protocol use?",true,{"title":115,"description":1002},"N7dx5IawyNlKzek8N87FDP6lWu9DzkgBLMMQxv9ox1w",[1016,1018],{"title":111,"path":112,"stem":113,"description":1017,"children":-1},"Read published content by path, id, type or singleton, with versioned URLs that can be cached forever",{"title":124,"path":125,"stem":126,"description":1019,"children":-1},"Read content with @avvyr\u002Fcms in any JavaScript runtime, and render blocks, images and rich text yourself",1793388935698]