[{"data":1,"prerenderedAt":1844},["ShallowReactive",2],{"navigation_docs":3,"-docs-core-operations-webhooks-receive-webhooks":478,"-docs-core-operations-webhooks-receive-webhooks-surround":1839},[4,352,446],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Docs",false,"\u002Fdocs\u002Fcore","docs\u002F1.core",[10,35,141,174,195,212,242,318],{"title":11,"icon":6,"path":12,"stem":13,"children":14,"page":6},"Getting Started","\u002Fdocs\u002Fcore\u002Fgetting-started","docs\u002F1.core\u002F1.getting-started",[15,19,23,27,31],{"title":16,"path":17,"stem":18},"Introduction","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fintroduction","docs\u002F1.core\u002F1.getting-started\u002F1.introduction",{"title":20,"path":21,"stem":22},"Quick Start","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fquick-start","docs\u002F1.core\u002F1.getting-started\u002F2.quick-start",{"title":24,"path":25,"stem":26},"Add to an Existing Site","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fexisting-site","docs\u002F1.core\u002F1.getting-started\u002F3.existing-site",{"title":28,"path":29,"stem":30},"Configuration","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fconfiguration","docs\u002F1.core\u002F1.getting-started\u002F4.configuration",{"title":32,"path":33,"stem":34},"How Tenon works","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fhow-tenon-works","docs\u002F1.core\u002F1.getting-started\u002F5.how-tenon-works",{"title":36,"icon":6,"path":37,"stem":38,"children":39,"page":6},"Content Modeling","\u002Fdocs\u002Fcore\u002Fcontent-modeling","docs\u002F1.core\u002F2.content-modeling",[40,44,111,115,119],{"title":41,"path":42,"stem":43},"Collections and Globals","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fcollections-and-globals","docs\u002F1.core\u002F2.content-modeling\u002F1.collections-and-globals",{"title":45,"icon":6,"path":46,"stem":47,"children":48},"Fields","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002Findex",[49,51,55,59,63,67,71,75,79,83,87,91,95,99,103,107],{"title":50,"path":46,"stem":47},"Overview",{"title":52,"path":53,"stem":54},"Array","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Farray","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F01.array",{"title":56,"path":57,"stem":58},"Blocks","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fblocks","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F02.blocks",{"title":60,"path":61,"stem":62},"Boolean","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fboolean","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F03.boolean",{"title":64,"path":65,"stem":66},"Date","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fdate","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F04.date",{"title":68,"path":69,"stem":70},"File","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Ffile","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F05.file",{"title":72,"path":73,"stem":74},"Group","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fgroup","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F06.group",{"title":76,"path":77,"stem":78},"Image","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fimage","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F07.image",{"title":80,"path":81,"stem":82},"Link","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Flink","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F08.link",{"title":84,"path":85,"stem":86},"Number","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fnumber","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F09.number",{"title":88,"path":89,"stem":90},"Relation","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Frelation","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F10.relation",{"title":92,"path":93,"stem":94},"Rich text","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Frich-text","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F11.rich-text",{"title":96,"path":97,"stem":98},"Select","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fselect","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F12.select",{"title":100,"path":101,"stem":102},"Size","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fsize","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F13.size",{"title":104,"path":105,"stem":106},"Slug","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fslug","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F14.slug",{"title":108,"path":109,"stem":110},"Text","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Ftext","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F15.text",{"title":112,"path":113,"stem":114},"Relations","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Frelations","docs\u002F1.core\u002F2.content-modeling\u002F3.relations",{"title":116,"path":117,"stem":118},"Media","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fmedia","docs\u002F1.core\u002F2.content-modeling\u002F4.media",{"title":120,"icon":6,"path":121,"stem":122,"children":123},"Presets","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002Findex",[124,125,129,133,137],{"title":50,"path":121,"stem":122},{"title":126,"path":127,"stem":128},"Menu","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fmenu","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F1.menu",{"title":130,"path":131,"stem":132},"Pages","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fpages","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F2.pages",{"title":134,"path":135,"stem":136},"Settings","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fsettings","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F3.settings",{"title":138,"path":139,"stem":140},"Strings","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fstrings","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F4.strings",{"title":142,"icon":6,"path":143,"stem":144,"children":145,"page":6},"Working with Content","\u002Fdocs\u002Fcore\u002Fworking-with-content","docs\u002F1.core\u002F3.working-with-content",[146,150,154,158,162,166,170],{"title":147,"path":148,"stem":149},"Reading","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Freading","docs\u002F1.core\u002F3.working-with-content\u002F1.reading",{"title":151,"path":152,"stem":153},"Writing and Drafts","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fwriting","docs\u002F1.core\u002F3.working-with-content\u002F2.writing",{"title":155,"path":156,"stem":157},"Scheduled publishing","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fscheduled-publishing","docs\u002F1.core\u002F3.working-with-content\u002F3.scheduled-publishing",{"title":159,"path":160,"stem":161},"HTTP API and Client","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fhttp-api-and-client","docs\u002F1.core\u002F3.working-with-content\u002F4.http-api-and-client",{"title":163,"path":164,"stem":165},"Headless","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fheadless","docs\u002F1.core\u002F3.working-with-content\u002F5.headless",{"title":167,"path":168,"stem":169},"Localization","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Flocalization","docs\u002F1.core\u002F3.working-with-content\u002F6.localization",{"title":171,"path":172,"stem":173},"Hooks","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fhooks","docs\u002F1.core\u002F3.working-with-content\u002F7.hooks",{"title":175,"icon":6,"path":176,"stem":177,"children":178,"page":6},"Building Your Site","\u002Fdocs\u002Fcore\u002Fbuilding-your-site","docs\u002F1.core\u002F4.building-your-site",[179,183,187,191],{"title":180,"path":181,"stem":182},"Pages and SEO","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fpages-and-seo","docs\u002F1.core\u002F4.building-your-site\u002F1.pages-and-seo",{"title":184,"path":185,"stem":186},"Components","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fcomponents","docs\u002F1.core\u002F4.building-your-site\u002F2.components",{"title":188,"path":189,"stem":190},"Menus","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fmenus","docs\u002F1.core\u002F4.building-your-site\u002F3.menus",{"title":192,"path":193,"stem":194},"Live Preview","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Flive-preview","docs\u002F1.core\u002F4.building-your-site\u002F4.live-preview",{"title":196,"icon":6,"path":197,"stem":198,"children":199,"page":6},"Users and Access","\u002Fdocs\u002Fcore\u002Fusers-and-access","docs\u002F1.core\u002F5.users-and-access",[200,204,208],{"title":201,"path":202,"stem":203},"Authentication","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Fauthentication","docs\u002F1.core\u002F5.users-and-access\u002F1.authentication",{"title":205,"path":206,"stem":207},"Access Control","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Faccess-control","docs\u002F1.core\u002F5.users-and-access\u002F2.access-control",{"title":209,"path":210,"stem":211},"API Keys","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Fapi-keys","docs\u002F1.core\u002F5.users-and-access\u002F3.api-keys",{"title":213,"icon":6,"path":214,"stem":215,"children":216},"Customization","\u002Fdocs\u002Fcore\u002Fcustomization","docs\u002F1.core\u002F6.customization\u002Findex",[217,218,222,226,230,234,238],{"title":50,"path":214,"stem":215},{"title":219,"path":220,"stem":221},"Admin","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fadmin","docs\u002F1.core\u002F6.customization\u002F1.admin",{"title":223,"path":224,"stem":225},"Custom Fields","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fcustom-fields","docs\u002F1.core\u002F6.customization\u002F2.custom-fields",{"title":227,"path":228,"stem":229},"Custom Pages and Actions","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fcustom-pages-and-actions","docs\u002F1.core\u002F6.customization\u002F3.custom-pages-and-actions",{"title":231,"path":232,"stem":233},"Styles and UI Libraries","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fstyles-and-ui-libraries","docs\u002F1.core\u002F6.customization\u002F4.styles-and-ui-libraries",{"title":235,"path":236,"stem":237},"Rich Text Extensions","\u002Fdocs\u002Fcore\u002Fcustomization\u002Frich-text-extensions","docs\u002F1.core\u002F6.customization\u002F5.rich-text-extensions",{"title":239,"path":240,"stem":241},"Plugins","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fplugins","docs\u002F1.core\u002F6.customization\u002F6.plugins",{"title":243,"icon":6,"path":244,"stem":245,"children":246},"Operations","\u002Fdocs\u002Fcore\u002Foperations","docs\u002F1.core\u002F7.operations\u002Findex",[247,248,266,288,306,310,314],{"title":50,"path":244,"stem":245},{"title":249,"icon":6,"path":250,"stem":251,"children":252},"Email","\u002Fdocs\u002Fcore\u002Foperations\u002Femail","docs\u002F1.core\u002F7.operations\u002F1.email\u002Findex",[253,254,258,262],{"title":50,"path":250,"stem":251},{"title":255,"path":256,"stem":257},"SMTP","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fsmtp","docs\u002F1.core\u002F7.operations\u002F1.email\u002F1.smtp",{"title":259,"path":260,"stem":261},"Cloudflare","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fcloudflare","docs\u002F1.core\u002F7.operations\u002F1.email\u002F2.cloudflare",{"title":263,"path":264,"stem":265},"Custom adapter","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fcustom-adapter","docs\u002F1.core\u002F7.operations\u002F1.email\u002F3.custom-adapter",{"title":267,"icon":6,"path":268,"stem":269,"children":270},"Jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002Findex",[271,272,276,280,284],{"title":50,"path":268,"stem":269},{"title":273,"path":274,"stem":275},"Queue jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fqueue-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F1.queue-jobs",{"title":277,"path":278,"stem":279},"Recurring jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Frecurring-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F2.recurring-jobs",{"title":281,"path":282,"stem":283},"The clock","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fclock","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F3.clock",{"title":285,"path":286,"stem":287},"Manage jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fmanage-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F4.manage-jobs",{"title":289,"icon":6,"path":290,"stem":291,"children":292},"Webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002Findex",[293,294,298,302],{"title":50,"path":290,"stem":291},{"title":295,"path":296,"stem":297},"Send webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Fsend-webhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F1.send-webhooks",{"title":299,"path":300,"stem":301},"Receive webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Freceive-webhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F2.receive-webhooks",{"title":303,"path":304,"stem":305},"Rebuild on publish","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Frebuild-on-publish","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F3.rebuild-on-publish",{"title":307,"path":308,"stem":309},"Backup and Restore","\u002Fdocs\u002Fcore\u002Foperations\u002Fbackup-and-restore","docs\u002F1.core\u002F7.operations\u002F4.backup-and-restore",{"title":311,"path":312,"stem":313},"Lifecycle Hooks","\u002Fdocs\u002Fcore\u002Foperations\u002Flifecycle-hooks","docs\u002F1.core\u002F7.operations\u002F5.lifecycle-hooks",{"title":315,"path":316,"stem":317},"Upgrades and Schema Changes","\u002Fdocs\u002Fcore\u002Foperations\u002Fupgrades-and-schema-changes","docs\u002F1.core\u002F7.operations\u002F6.upgrades-and-schema-changes",{"title":319,"icon":6,"path":320,"stem":321,"children":322,"page":6},"Reference","\u002Fdocs\u002Fcore\u002Freference","docs\u002F1.core\u002F8.reference",[323,326,344,348],{"title":28,"path":324,"stem":325},"\u002Fdocs\u002Fcore\u002Freference\u002Fconfiguration","docs\u002F1.core\u002F8.reference\u002F1.configuration",{"title":327,"icon":6,"path":328,"stem":329,"children":330},"API","\u002Fdocs\u002Fcore\u002Freference\u002Fapi","docs\u002F1.core\u002F8.reference\u002F2.api\u002Findex",[331,332,336,340],{"title":50,"path":328,"stem":329},{"title":333,"path":334,"stem":335},"Local API","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Flocal-api","docs\u002F1.core\u002F8.reference\u002F2.api\u002F1.local-api",{"title":337,"path":338,"stem":339},"Client","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Fclient","docs\u002F1.core\u002F8.reference\u002F2.api\u002F2.client",{"title":341,"path":342,"stem":343},"HTTP routes","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Fhttp-routes","docs\u002F1.core\u002F8.reference\u002F2.api\u002F3.http-routes",{"title":345,"path":346,"stem":347},"Errors and types","\u002Fdocs\u002Fcore\u002Freference\u002Ferrors-and-types","docs\u002F1.core\u002F8.reference\u002F3.errors-and-types",{"title":349,"path":350,"stem":351},"Package exports","\u002Fdocs\u002Fcore\u002Freference\u002Fpackage-exports","docs\u002F1.core\u002F8.reference\u002F4.package-exports",{"title":353,"icon":6,"path":354,"stem":355,"children":356,"page":6},"Guide","\u002Fdocs\u002Fguide","docs\u002F2.guide",[357,383,400,417],{"title":358,"icon":6,"path":359,"stem":360,"children":361},"Frameworks","\u002Fdocs\u002Fguide\u002Fframeworks","docs\u002F2.guide\u002F1.frameworks\u002Findex",[362,363,367,371,375,379],{"title":50,"path":359,"stem":360},{"title":364,"path":365,"stem":366},"Astro","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fastro","docs\u002F2.guide\u002F1.frameworks\u002F1.astro",{"title":368,"path":369,"stem":370},"Nuxt","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fnuxt","docs\u002F2.guide\u002F1.frameworks\u002F2.nuxt",{"title":372,"path":373,"stem":374},"TanStack Start","\u002Fdocs\u002Fguide\u002Fframeworks\u002Ftanstack-start","docs\u002F2.guide\u002F1.frameworks\u002F3.tanstack-start",{"title":376,"path":377,"stem":378},"Standalone","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fstandalone","docs\u002F2.guide\u002F1.frameworks\u002F4.standalone",{"title":380,"path":381,"stem":382},"Other Frameworks","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fother-frameworks","docs\u002F2.guide\u002F1.frameworks\u002F5.other-frameworks",{"title":384,"icon":6,"path":385,"stem":386,"children":387},"Deployment","\u002Fdocs\u002Fguide\u002Fdeployment","docs\u002F2.guide\u002F2.deployment\u002Findex",[388,389,393,397],{"title":50,"path":385,"stem":386},{"title":390,"path":391,"stem":392},"Node","\u002Fdocs\u002Fguide\u002Fdeployment\u002Fnode","docs\u002F2.guide\u002F2.deployment\u002F1.node",{"title":394,"path":395,"stem":396},"Vercel","\u002Fdocs\u002Fguide\u002Fdeployment\u002Fvercel","docs\u002F2.guide\u002F2.deployment\u002F2.vercel",{"title":259,"path":398,"stem":399},"\u002Fdocs\u002Fguide\u002Fdeployment\u002Fcloudflare","docs\u002F2.guide\u002F2.deployment\u002F3.cloudflare",{"title":401,"icon":6,"path":402,"stem":403,"children":404,"page":6},"Databases and Storage","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage","docs\u002F2.guide\u002F3.databases-and-storage",[405,409,413],{"title":406,"path":407,"stem":408},"Databases","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fdatabases","docs\u002F2.guide\u002F3.databases-and-storage\u002F1.databases",{"title":410,"path":411,"stem":412},"Media Storage","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fmedia-storage","docs\u002F2.guide\u002F3.databases-and-storage\u002F2.media-storage",{"title":414,"path":415,"stem":416},"Image Providers","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fimage-providers","docs\u002F2.guide\u002F3.databases-and-storage\u002F3.image-providers",{"title":418,"icon":6,"path":419,"stem":420,"children":421,"page":6},"Recipes","\u002Fdocs\u002Fguide\u002Frecipes","docs\u002F2.guide\u002F4.recipes",[422,426,430,434,438,442],{"title":423,"path":424,"stem":425},"Seed Content","\u002Fdocs\u002Fguide\u002Frecipes\u002Fseed-content","docs\u002F2.guide\u002F4.recipes\u002F1.seed-content",{"title":427,"path":428,"stem":429},"Tracking and Consent","\u002Fdocs\u002Fguide\u002Frecipes\u002Ftracking-and-consent","docs\u002F2.guide\u002F4.recipes\u002F2.tracking-and-consent",{"title":431,"path":432,"stem":433},"Build a Custom Field","\u002Fdocs\u002Fguide\u002Frecipes\u002Fbuild-a-custom-field","docs\u002F2.guide\u002F4.recipes\u002F3.build-a-custom-field",{"title":435,"path":436,"stem":437},"Write a Plugin","\u002Fdocs\u002Fguide\u002Frecipes\u002Fwrite-a-plugin","docs\u002F2.guide\u002F4.recipes\u002F4.write-a-plugin",{"title":439,"path":440,"stem":441},"Build a Headless Site with Next.js","\u002Fdocs\u002Fguide\u002Frecipes\u002Fbuild-a-headless-site-with-nextjs","docs\u002F2.guide\u002F4.recipes\u002F5.build-a-headless-site-with-nextjs",{"title":443,"path":444,"stem":445},"Troubleshooting","\u002Fdocs\u002Fguide\u002Frecipes\u002Ftroubleshooting","docs\u002F2.guide\u002F4.recipes\u002F6.troubleshooting",{"title":447,"icon":6,"path":448,"stem":449,"children":450,"page":6},"CLI","\u002Fdocs\u002Fcli","docs\u002F3.cli",[451,454,458,462,466,470,474],{"title":50,"path":452,"stem":453},"\u002Fdocs\u002Fcli\u002Foverview","docs\u002F3.cli\u002F1.overview",{"title":455,"path":456,"stem":457},"create-tenoncms","\u002Fdocs\u002Fcli\u002Fcreate-tenoncms","docs\u002F3.cli\u002F2.create-tenoncms",{"title":459,"path":460,"stem":461},"tenon backup","\u002Fdocs\u002Fcli\u002Fbackup","docs\u002F3.cli\u002F3.backup",{"title":463,"path":464,"stem":465},"tenon users","\u002Fdocs\u002Fcli\u002Fusers","docs\u002F3.cli\u002F4.users",{"title":467,"path":468,"stem":469},"tenon media","\u002Fdocs\u002Fcli\u002Fmedia","docs\u002F3.cli\u002F5.media",{"title":471,"path":472,"stem":473},"tenon upgrade","\u002Fdocs\u002Fcli\u002Fupgrade","docs\u002F3.cli\u002F6.upgrade",{"title":475,"path":476,"stem":477},"tenon login","\u002Fdocs\u002Fcli\u002Flogin","docs\u002F3.cli\u002F7.login",{"id":479,"title":299,"body":480,"description":1833,"extension":1834,"links":1835,"meta":1836,"navigation":633,"path":300,"seo":1837,"stem":301,"__hash__":1838},"docs\u002Fdocs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F2.receive-webhooks.md",{"type":481,"value":482,"toc":1825},"minimark",[483,487,532,537,561,565,576,1640,1643,1715,1724,1729,1753,1757,1760,1799,1803,1821],[484,485,486],"p",{},"Sometimes the data flows the other way: a shop system changes the price of a product, and the product page should show the new price. Tenon has no built-in route for incoming webhooks. Pick the way that fits the sender:",[488,489,490,503],"table",{},[491,492,493],"thead",{},[494,495,496,500],"tr",{},[497,498,499],"th",{},"The sender",[497,501,502],{},"Use",[504,505,506,520],"tbody",{},[494,507,508,512],{},[509,510,511],"td",{},"Can call an API with a header, like n8n, Zapier or your own script",[509,513,514,519],{},[515,516,518],"a",{"href":517},"#use-an-api-key","An API key",". No code in Tenon.",[494,521,522,525],{},[509,523,524],{},"Sends its own webhook format to a URL, like most shop systems",[509,526,527,531],{},[515,528,530],{"href":529},"#add-a-webhook-route","A webhook route"," in a plugin.",[533,534,536],"h2",{"id":535},"use-an-api-key","Use an API key",[484,538,539,540,543,544,548,549,552,553,556,557,560],{},"Create an ",[515,541,542],{"href":210},"API key"," with ",[545,546,547],"code",{},"update"," on the collection, for example ",[545,550,551],{},"collection:products",". The sender then calls the ",[515,554,555],{"href":160},"HTTP API"," with the key in the ",[545,558,559],{},"x-api-key"," header. The key may change only what its permissions allow, and every write is validated like a write from the admin.",[533,562,564],{"id":563},"add-a-webhook-route","Add a webhook route",[484,566,567,568,571,572,575],{},"A plugin can add a public route under ",[545,569,570],{},"\u002F_tenon\u002F\u003Cplugin name>",". The route checks the request and queues a ",[515,573,574],{"href":268},"job",". The job writes the change:",[577,578,584],"pre",{"className":579,"code":580,"filename":581,"language":582,"meta":583,"style":583},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { definePlugin, defineTask } from \"tenoncms\";\n\nexport const shop = definePlugin({\n  name: \"shop\",\n  publicRoutes: (api) =>\n    api.post(\"\u002Fwebhook\", async (c) => {\n      const body = await c.req.text();\n      if (!(await isSignedByShop(body, c.req.header(\"x-shop-signature\")))) {\n        return c.body(null, 401);\n      }\n      const { sku, price } = JSON.parse(body);\n      await c.var.cms.jobs.queue(\"shop:update-price\", { sku, price });\n      return c.body(null, 202);\n    }),\n  jobs: {\n    tasks: {\n      \"shop:update-price\": defineTask({\n        run: async ({ payload, cms }) => {\n          const { sku, price } = payload as { sku: string; price: number };\n          const product = await cms.findOne(\"products\", { where: { sku } });\n          if (!product) return \"unknown sku\";\n\n          await cms.update(\"products\", product.id, { price });\n          return \"updated\";\n        },\n      }),\n    },\n  },\n});\n\nasync function isSignedByShop(body: string, signature: string | undefined) {\n  if (!signature) return false;\n  const encoder = new TextEncoder();\n  const key = await crypto.subtle.importKey(\n    \"raw\",\n    encoder.encode(process.env.SHOP_WEBHOOK_SECRET),\n    { name: \"HMAC\", hash: \"SHA-256\" },\n    false,\n    [\"verify\"],\n  );\n  try {\n    const expected = Uint8Array.from(atob(signature), (char) => char.charCodeAt(0));\n    return await crypto.subtle.verify(\"HMAC\", key, expected, encoder.encode(body));\n  } catch {\n    return false;\n  }\n}\n","cms\u002Fplugins\u002Fshop.ts","ts","",[545,585,586,628,635,660,680,701,740,773,824,849,855,890,943,966,976,986,996,1014,1042,1088,1137,1165,1170,1211,1226,1232,1242,1248,1254,1264,1269,1307,1330,1351,1379,1392,1422,1457,1465,1483,1491,1499,1558,1608,1619,1628,1634],{"__ignoreMap":583},[587,588,591,595,599,603,606,609,612,615,618,622,625],"span",{"class":589,"line":590},"line",1,[587,592,594],{"class":593},"s7zQu","import",[587,596,598],{"class":597},"sMK4o"," {",[587,600,602],{"class":601},"sTEyZ"," definePlugin",[587,604,605],{"class":597},",",[587,607,608],{"class":601}," defineTask",[587,610,611],{"class":597}," }",[587,613,614],{"class":593}," from",[587,616,617],{"class":597}," \"",[587,619,621],{"class":620},"sfazB","tenoncms",[587,623,624],{"class":597},"\"",[587,626,627],{"class":597},";\n",[587,629,631],{"class":589,"line":630},2,[587,632,634],{"emptyLinePlaceholder":633},true,"\n",[587,636,638,641,645,648,651,654,657],{"class":589,"line":637},3,[587,639,640],{"class":593},"export",[587,642,644],{"class":643},"spNyl"," const",[587,646,647],{"class":601}," shop ",[587,649,650],{"class":597},"=",[587,652,602],{"class":653},"s2Zo4",[587,655,656],{"class":601},"(",[587,658,659],{"class":597},"{\n",[587,661,663,667,670,672,675,677],{"class":589,"line":662},4,[587,664,666],{"class":665},"swJcz","  name",[587,668,669],{"class":597},":",[587,671,617],{"class":597},[587,673,674],{"class":620},"shop",[587,676,624],{"class":597},[587,678,679],{"class":597},",\n",[587,681,683,686,688,691,695,698],{"class":589,"line":682},5,[587,684,685],{"class":653},"  publicRoutes",[587,687,669],{"class":597},[587,689,690],{"class":597}," (",[587,692,694],{"class":693},"sHdIc","api",[587,696,697],{"class":597},")",[587,699,700],{"class":643}," =>\n",[587,702,704,707,710,713,715,717,720,722,724,727,729,732,734,737],{"class":589,"line":703},6,[587,705,706],{"class":601},"    api",[587,708,709],{"class":597},".",[587,711,712],{"class":653},"post",[587,714,656],{"class":601},[587,716,624],{"class":597},[587,718,719],{"class":620},"\u002Fwebhook",[587,721,624],{"class":597},[587,723,605],{"class":597},[587,725,726],{"class":643}," async",[587,728,690],{"class":597},[587,730,731],{"class":693},"c",[587,733,697],{"class":597},[587,735,736],{"class":643}," =>",[587,738,739],{"class":597}," {\n",[587,741,743,746,749,752,755,758,760,763,765,768,771],{"class":589,"line":742},7,[587,744,745],{"class":643},"      const",[587,747,748],{"class":601}," body",[587,750,751],{"class":597}," =",[587,753,754],{"class":593}," await",[587,756,757],{"class":601}," c",[587,759,709],{"class":597},[587,761,762],{"class":601},"req",[587,764,709],{"class":597},[587,766,767],{"class":653},"text",[587,769,770],{"class":665},"()",[587,772,627],{"class":597},[587,774,776,779,781,784,786,789,792,794,797,799,801,803,805,807,810,812,814,817,819,822],{"class":589,"line":775},8,[587,777,778],{"class":593},"      if",[587,780,690],{"class":665},[587,782,783],{"class":597},"!",[587,785,656],{"class":665},[587,787,788],{"class":593},"await",[587,790,791],{"class":653}," isSignedByShop",[587,793,656],{"class":665},[587,795,796],{"class":601},"body",[587,798,605],{"class":597},[587,800,757],{"class":601},[587,802,709],{"class":597},[587,804,762],{"class":601},[587,806,709],{"class":597},[587,808,809],{"class":653},"header",[587,811,656],{"class":665},[587,813,624],{"class":597},[587,815,816],{"class":620},"x-shop-signature",[587,818,624],{"class":597},[587,820,821],{"class":665},")))) ",[587,823,659],{"class":597},[587,825,827,830,832,834,836,838,841,845,847],{"class":589,"line":826},9,[587,828,829],{"class":593},"        return",[587,831,757],{"class":601},[587,833,709],{"class":597},[587,835,796],{"class":653},[587,837,656],{"class":665},[587,839,840],{"class":597},"null,",[587,842,844],{"class":843},"sbssI"," 401",[587,846,697],{"class":665},[587,848,627],{"class":597},[587,850,852],{"class":589,"line":851},10,[587,853,854],{"class":597},"      }\n",[587,856,858,860,862,865,867,870,872,874,877,879,882,884,886,888],{"class":589,"line":857},11,[587,859,745],{"class":643},[587,861,598],{"class":597},[587,863,864],{"class":601}," sku",[587,866,605],{"class":597},[587,868,869],{"class":601}," price",[587,871,611],{"class":597},[587,873,751],{"class":597},[587,875,876],{"class":601}," JSON",[587,878,709],{"class":597},[587,880,881],{"class":653},"parse",[587,883,656],{"class":665},[587,885,796],{"class":601},[587,887,697],{"class":665},[587,889,627],{"class":597},[587,891,893,896,898,900,903,905,908,910,913,915,918,920,922,925,927,929,931,933,935,937,939,941],{"class":589,"line":892},12,[587,894,895],{"class":593},"      await",[587,897,757],{"class":601},[587,899,709],{"class":597},[587,901,902],{"class":601},"var",[587,904,709],{"class":597},[587,906,907],{"class":601},"cms",[587,909,709],{"class":597},[587,911,912],{"class":601},"jobs",[587,914,709],{"class":597},[587,916,917],{"class":653},"queue",[587,919,656],{"class":665},[587,921,624],{"class":597},[587,923,924],{"class":620},"shop:update-price",[587,926,624],{"class":597},[587,928,605],{"class":597},[587,930,598],{"class":597},[587,932,864],{"class":601},[587,934,605],{"class":597},[587,936,869],{"class":601},[587,938,611],{"class":597},[587,940,697],{"class":665},[587,942,627],{"class":597},[587,944,946,949,951,953,955,957,959,962,964],{"class":589,"line":945},13,[587,947,948],{"class":593},"      return",[587,950,757],{"class":601},[587,952,709],{"class":597},[587,954,796],{"class":653},[587,956,656],{"class":665},[587,958,840],{"class":597},[587,960,961],{"class":843}," 202",[587,963,697],{"class":665},[587,965,627],{"class":597},[587,967,969,972,974],{"class":589,"line":968},14,[587,970,971],{"class":597},"    }",[587,973,697],{"class":601},[587,975,679],{"class":597},[587,977,979,982,984],{"class":589,"line":978},15,[587,980,981],{"class":665},"  jobs",[587,983,669],{"class":597},[587,985,739],{"class":597},[587,987,989,992,994],{"class":589,"line":988},16,[587,990,991],{"class":665},"    tasks",[587,993,669],{"class":597},[587,995,739],{"class":597},[587,997,999,1002,1004,1006,1008,1010,1012],{"class":589,"line":998},17,[587,1000,1001],{"class":597},"      \"",[587,1003,924],{"class":665},[587,1005,624],{"class":597},[587,1007,669],{"class":597},[587,1009,608],{"class":653},[587,1011,656],{"class":601},[587,1013,659],{"class":597},[587,1015,1017,1020,1022,1024,1027,1030,1032,1035,1038,1040],{"class":589,"line":1016},18,[587,1018,1019],{"class":653},"        run",[587,1021,669],{"class":597},[587,1023,726],{"class":643},[587,1025,1026],{"class":597}," ({",[587,1028,1029],{"class":693}," payload",[587,1031,605],{"class":597},[587,1033,1034],{"class":693}," cms",[587,1036,1037],{"class":597}," })",[587,1039,736],{"class":643},[587,1041,739],{"class":597},[587,1043,1045,1048,1050,1052,1054,1056,1058,1060,1062,1065,1067,1069,1071,1075,1078,1080,1082,1085],{"class":589,"line":1044},19,[587,1046,1047],{"class":643},"          const",[587,1049,598],{"class":597},[587,1051,864],{"class":601},[587,1053,605],{"class":597},[587,1055,869],{"class":601},[587,1057,611],{"class":597},[587,1059,751],{"class":597},[587,1061,1029],{"class":601},[587,1063,1064],{"class":593}," as",[587,1066,598],{"class":597},[587,1068,864],{"class":665},[587,1070,669],{"class":597},[587,1072,1074],{"class":1073},"sBMFI"," string",[587,1076,1077],{"class":597},";",[587,1079,869],{"class":665},[587,1081,669],{"class":597},[587,1083,1084],{"class":1073}," number",[587,1086,1087],{"class":597}," };\n",[587,1089,1091,1093,1096,1098,1100,1102,1104,1107,1109,1111,1114,1116,1118,1120,1123,1125,1127,1129,1131,1133,1135],{"class":589,"line":1090},20,[587,1092,1047],{"class":643},[587,1094,1095],{"class":601}," product",[587,1097,751],{"class":597},[587,1099,754],{"class":593},[587,1101,1034],{"class":601},[587,1103,709],{"class":597},[587,1105,1106],{"class":653},"findOne",[587,1108,656],{"class":665},[587,1110,624],{"class":597},[587,1112,1113],{"class":620},"products",[587,1115,624],{"class":597},[587,1117,605],{"class":597},[587,1119,598],{"class":597},[587,1121,1122],{"class":665}," where",[587,1124,669],{"class":597},[587,1126,598],{"class":597},[587,1128,864],{"class":601},[587,1130,611],{"class":597},[587,1132,611],{"class":597},[587,1134,697],{"class":665},[587,1136,627],{"class":597},[587,1138,1140,1143,1145,1147,1150,1153,1156,1158,1161,1163],{"class":589,"line":1139},21,[587,1141,1142],{"class":593},"          if",[587,1144,690],{"class":665},[587,1146,783],{"class":597},[587,1148,1149],{"class":601},"product",[587,1151,1152],{"class":665},") ",[587,1154,1155],{"class":593},"return",[587,1157,617],{"class":597},[587,1159,1160],{"class":620},"unknown sku",[587,1162,624],{"class":597},[587,1164,627],{"class":597},[587,1166,1168],{"class":589,"line":1167},22,[587,1169,634],{"emptyLinePlaceholder":633},[587,1171,1173,1176,1178,1180,1182,1184,1186,1188,1190,1192,1194,1196,1199,1201,1203,1205,1207,1209],{"class":589,"line":1172},23,[587,1174,1175],{"class":593},"          await",[587,1177,1034],{"class":601},[587,1179,709],{"class":597},[587,1181,547],{"class":653},[587,1183,656],{"class":665},[587,1185,624],{"class":597},[587,1187,1113],{"class":620},[587,1189,624],{"class":597},[587,1191,605],{"class":597},[587,1193,1095],{"class":601},[587,1195,709],{"class":597},[587,1197,1198],{"class":601},"id",[587,1200,605],{"class":597},[587,1202,598],{"class":597},[587,1204,869],{"class":601},[587,1206,611],{"class":597},[587,1208,697],{"class":665},[587,1210,627],{"class":597},[587,1212,1214,1217,1219,1222,1224],{"class":589,"line":1213},24,[587,1215,1216],{"class":593},"          return",[587,1218,617],{"class":597},[587,1220,1221],{"class":620},"updated",[587,1223,624],{"class":597},[587,1225,627],{"class":597},[587,1227,1229],{"class":589,"line":1228},25,[587,1230,1231],{"class":597},"        },\n",[587,1233,1235,1238,1240],{"class":589,"line":1234},26,[587,1236,1237],{"class":597},"      }",[587,1239,697],{"class":601},[587,1241,679],{"class":597},[587,1243,1245],{"class":589,"line":1244},27,[587,1246,1247],{"class":597},"    },\n",[587,1249,1251],{"class":589,"line":1250},28,[587,1252,1253],{"class":597},"  },\n",[587,1255,1257,1260,1262],{"class":589,"line":1256},29,[587,1258,1259],{"class":597},"}",[587,1261,697],{"class":601},[587,1263,627],{"class":597},[587,1265,1267],{"class":589,"line":1266},30,[587,1268,634],{"emptyLinePlaceholder":633},[587,1270,1272,1275,1278,1280,1282,1284,1286,1288,1290,1293,1295,1297,1300,1303,1305],{"class":589,"line":1271},31,[587,1273,1274],{"class":643},"async",[587,1276,1277],{"class":643}," function",[587,1279,791],{"class":653},[587,1281,656],{"class":597},[587,1283,796],{"class":693},[587,1285,669],{"class":597},[587,1287,1074],{"class":1073},[587,1289,605],{"class":597},[587,1291,1292],{"class":693}," signature",[587,1294,669],{"class":597},[587,1296,1074],{"class":1073},[587,1298,1299],{"class":597}," |",[587,1301,1302],{"class":1073}," undefined",[587,1304,697],{"class":597},[587,1306,739],{"class":597},[587,1308,1310,1313,1315,1317,1320,1322,1324,1328],{"class":589,"line":1309},32,[587,1311,1312],{"class":593},"  if",[587,1314,690],{"class":665},[587,1316,783],{"class":597},[587,1318,1319],{"class":601},"signature",[587,1321,1152],{"class":665},[587,1323,1155],{"class":593},[587,1325,1327],{"class":1326},"sfNiH"," false",[587,1329,627],{"class":597},[587,1331,1333,1336,1339,1341,1344,1347,1349],{"class":589,"line":1332},33,[587,1334,1335],{"class":643},"  const",[587,1337,1338],{"class":601}," encoder",[587,1340,751],{"class":597},[587,1342,1343],{"class":597}," new",[587,1345,1346],{"class":653}," TextEncoder",[587,1348,770],{"class":665},[587,1350,627],{"class":597},[587,1352,1354,1356,1359,1361,1363,1366,1368,1371,1373,1376],{"class":589,"line":1353},34,[587,1355,1335],{"class":643},[587,1357,1358],{"class":601}," key",[587,1360,751],{"class":597},[587,1362,754],{"class":593},[587,1364,1365],{"class":601}," crypto",[587,1367,709],{"class":597},[587,1369,1370],{"class":601},"subtle",[587,1372,709],{"class":597},[587,1374,1375],{"class":653},"importKey",[587,1377,1378],{"class":665},"(\n",[587,1380,1382,1385,1388,1390],{"class":589,"line":1381},35,[587,1383,1384],{"class":597},"    \"",[587,1386,1387],{"class":620},"raw",[587,1389,624],{"class":597},[587,1391,679],{"class":597},[587,1393,1395,1398,1400,1403,1405,1408,1410,1413,1415,1418,1420],{"class":589,"line":1394},36,[587,1396,1397],{"class":601},"    encoder",[587,1399,709],{"class":597},[587,1401,1402],{"class":653},"encode",[587,1404,656],{"class":665},[587,1406,1407],{"class":601},"process",[587,1409,709],{"class":597},[587,1411,1412],{"class":601},"env",[587,1414,709],{"class":597},[587,1416,1417],{"class":601},"SHOP_WEBHOOK_SECRET",[587,1419,697],{"class":665},[587,1421,679],{"class":597},[587,1423,1425,1428,1431,1433,1435,1438,1440,1442,1445,1447,1449,1452,1454],{"class":589,"line":1424},37,[587,1426,1427],{"class":597},"    {",[587,1429,1430],{"class":665}," name",[587,1432,669],{"class":597},[587,1434,617],{"class":597},[587,1436,1437],{"class":620},"HMAC",[587,1439,624],{"class":597},[587,1441,605],{"class":597},[587,1443,1444],{"class":665}," hash",[587,1446,669],{"class":597},[587,1448,617],{"class":597},[587,1450,1451],{"class":620},"SHA-256",[587,1453,624],{"class":597},[587,1455,1456],{"class":597}," },\n",[587,1458,1460,1463],{"class":589,"line":1459},38,[587,1461,1462],{"class":1326},"    false",[587,1464,679],{"class":597},[587,1466,1468,1471,1473,1476,1478,1481],{"class":589,"line":1467},39,[587,1469,1470],{"class":665},"    [",[587,1472,624],{"class":597},[587,1474,1475],{"class":620},"verify",[587,1477,624],{"class":597},[587,1479,1480],{"class":665},"]",[587,1482,679],{"class":597},[587,1484,1486,1489],{"class":589,"line":1485},40,[587,1487,1488],{"class":665},"  )",[587,1490,627],{"class":597},[587,1492,1494,1497],{"class":589,"line":1493},41,[587,1495,1496],{"class":593},"  try",[587,1498,739],{"class":597},[587,1500,1502,1505,1508,1510,1513,1515,1518,1520,1523,1525,1527,1529,1531,1533,1536,1538,1540,1543,1545,1548,1550,1553,1556],{"class":589,"line":1501},42,[587,1503,1504],{"class":643},"    const",[587,1506,1507],{"class":601}," expected",[587,1509,751],{"class":597},[587,1511,1512],{"class":601}," Uint8Array",[587,1514,709],{"class":597},[587,1516,1517],{"class":653},"from",[587,1519,656],{"class":665},[587,1521,1522],{"class":653},"atob",[587,1524,656],{"class":665},[587,1526,1319],{"class":601},[587,1528,697],{"class":665},[587,1530,605],{"class":597},[587,1532,690],{"class":597},[587,1534,1535],{"class":693},"char",[587,1537,697],{"class":597},[587,1539,736],{"class":643},[587,1541,1542],{"class":601}," char",[587,1544,709],{"class":597},[587,1546,1547],{"class":653},"charCodeAt",[587,1549,656],{"class":665},[587,1551,1552],{"class":843},"0",[587,1554,1555],{"class":665},"))",[587,1557,627],{"class":597},[587,1559,1561,1564,1566,1568,1570,1572,1574,1576,1578,1580,1582,1584,1586,1588,1590,1592,1594,1596,1598,1600,1602,1604,1606],{"class":589,"line":1560},43,[587,1562,1563],{"class":593},"    return",[587,1565,754],{"class":593},[587,1567,1365],{"class":601},[587,1569,709],{"class":597},[587,1571,1370],{"class":601},[587,1573,709],{"class":597},[587,1575,1475],{"class":653},[587,1577,656],{"class":665},[587,1579,624],{"class":597},[587,1581,1437],{"class":620},[587,1583,624],{"class":597},[587,1585,605],{"class":597},[587,1587,1358],{"class":601},[587,1589,605],{"class":597},[587,1591,1507],{"class":601},[587,1593,605],{"class":597},[587,1595,1338],{"class":601},[587,1597,709],{"class":597},[587,1599,1402],{"class":653},[587,1601,656],{"class":665},[587,1603,796],{"class":601},[587,1605,1555],{"class":665},[587,1607,627],{"class":597},[587,1609,1611,1614,1617],{"class":589,"line":1610},44,[587,1612,1613],{"class":597},"  }",[587,1615,1616],{"class":593}," catch",[587,1618,739],{"class":597},[587,1620,1622,1624,1626],{"class":589,"line":1621},45,[587,1623,1563],{"class":593},[587,1625,1327],{"class":1326},[587,1627,627],{"class":597},[587,1629,1631],{"class":589,"line":1630},46,[587,1632,1633],{"class":597},"  }\n",[587,1635,1637],{"class":589,"line":1636},47,[587,1638,1639],{"class":597},"}\n",[484,1641,1642],{},"Add the plugin to your config:",[577,1644,1647],{"className":579,"code":1645,"filename":1646,"language":582,"meta":583,"style":583},"import { shop } from \".\u002Fcms\u002Fplugins\u002Fshop\";\n\nexport default defineCms({\n  \u002F\u002F ...\n  plugins: [shop],\n});\n","tenon.config.ts",[545,1648,1649,1671,1675,1689,1695,1707],{"__ignoreMap":583},[587,1650,1651,1653,1655,1658,1660,1662,1664,1667,1669],{"class":589,"line":590},[587,1652,594],{"class":593},[587,1654,598],{"class":597},[587,1656,1657],{"class":601}," shop",[587,1659,611],{"class":597},[587,1661,614],{"class":593},[587,1663,617],{"class":597},[587,1665,1666],{"class":620},".\u002Fcms\u002Fplugins\u002Fshop",[587,1668,624],{"class":597},[587,1670,627],{"class":597},[587,1672,1673],{"class":589,"line":630},[587,1674,634],{"emptyLinePlaceholder":633},[587,1676,1677,1679,1682,1685,1687],{"class":589,"line":637},[587,1678,640],{"class":593},[587,1680,1681],{"class":593}," default",[587,1683,1684],{"class":653}," defineCms",[587,1686,656],{"class":601},[587,1688,659],{"class":597},[587,1690,1691],{"class":589,"line":662},[587,1692,1694],{"class":1693},"sHwdD","  \u002F\u002F ...\n",[587,1696,1697,1700,1702,1705],{"class":589,"line":682},[587,1698,1699],{"class":665},"  plugins",[587,1701,669],{"class":597},[587,1703,1704],{"class":601}," [shop]",[587,1706,679],{"class":597},[587,1708,1709,1711,1713],{"class":589,"line":703},[587,1710,1259],{"class":597},[587,1712,697],{"class":601},[587,1714,627],{"class":597},[484,1716,1717,1718,1721,1722,709],{},"In the shop system, set the webhook URL to ",[545,1719,1720],{},"https:\u002F\u002Fexample.com\u002F_tenon\u002Fshop\u002Fwebhook",", and copy its secret to ",[545,1723,1417],{},[1725,1726,1728],"h3",{"id":1727},"why-a-job","Why a job",[1730,1731,1732,1742,1745],"ul",{},[1733,1734,1735,1736,1738,1739,1741],"li",{},"The ",[545,1737,907],{}," of a public route has no user, so the access rules deny its writes. The ",[545,1740,907],{}," of a task is the server API and skips them.",[1733,1743,1744],{},"The route answers at once. A sender expects a quick answer and retries when it gets none.",[1733,1746,1747,1748,1752],{},"A failed write retries, and ",[1749,1750,1751],"strong",{},"Manage → Jobs"," shows it.",[1725,1754,1756],{"id":1755},"check-every-request","Check every request",[484,1758,1759],{},"The route is public, so anyone can call it.",[1730,1761,1762,1769,1772,1789,1792],{},[1733,1763,1764,1765,1768],{},"Check the signature before you use the payload. Answer ",[545,1766,1767],{},"401"," when it does not match.",[1733,1770,1771],{},"Read the body as text first. The signature covers the exact bytes, so a body that is parsed and serialized again no longer matches.",[1733,1773,1774,1775,1781,1782,1785,1786,1788],{},"Each sender signs in its own way. The example checks a base64 HMAC-SHA256 of the body, which many services use. Follow the docs of your sender. If it follows ",[515,1776,1780],{"href":1777,"rel":1778},"https:\u002F\u002Fwww.standardwebhooks.com\u002F",[1779],"nofollow","Standard Webhooks",", ",[545,1783,1784],{},"verifyWebhook(c.req.raw, secret)"," from ",[545,1787,621],{}," checks it.",[1733,1790,1791],{},"A sender can send the same event twice. Write the task so that running it twice does no harm, like setting a price.",[1733,1793,1794,1795,1798],{},"The task writes through the local API, so the field rules still apply. A ",[545,1796,1797],{},"price"," that is not a number fails the job.",[533,1800,1802],{"id":1801},"related-resources","Related resources",[1730,1804,1805,1810,1816],{},[1733,1806,1807,1809],{},[515,1808,239],{"href":240},": what else a plugin can add.",[1733,1811,1812,1815],{},[515,1813,1814],{"href":210},"API keys",": permissions for a sender that calls the API.",[1733,1817,1818,1820],{},[515,1819,295],{"href":296},": the other direction, from Tenon to another service.",[1822,1823,1824],"style",{},"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 .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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 .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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}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 .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":583,"searchDepth":630,"depth":630,"links":1826},[1827,1828,1832],{"id":535,"depth":630,"text":536},{"id":563,"depth":630,"text":564,"children":1829},[1830,1831],{"id":1727,"depth":637,"text":1728},{"id":1755,"depth":637,"text":1756},{"id":1801,"depth":630,"text":1802},"Let another service, like a shop system, change content in Tenon.","md",null,{},{"title":299,"description":1833},"QgsDLfrzWsUlIC_emNyw9xwKzHf8fu5XYzXLBLXW9j8",[1840,1842],{"title":295,"path":296,"stem":297,"description":1841,"children":-1},"Pick where a webhook goes, which changes send it, what its body holds and how it is signed.",{"title":303,"path":304,"stem":305,"description":1843,"children":-1},"Start a new build of a prerendered site when an editor publishes.",1795884724654]