@sonordev/site-kit 7.3.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/AGENTS.md +40 -12
  2. package/CHANGELOG.md +73 -0
  3. package/README.md +44 -18
  4. package/agent-manifest.json +111 -56
  5. package/dist/AnalyticsProvider-LYFDQRRJ.js +13 -0
  6. package/dist/{ArticleViewTracker-GFOAXFV7.js → ArticleViewTracker-HG7IIRJY.js} +6 -5
  7. package/dist/{BlocksPopup-AHDU34TL.js → BlocksPopup-GFX3GZIK.js} +6 -5
  8. package/dist/{ChatWidget-FHBAHFZX.js → ChatWidget-DVS7MLBN.js} +8 -5
  9. package/dist/{FileField-J5W5MIAZ.js → FileField-DVN7NUBI.js} +5 -5
  10. package/dist/{FormSpotlight-PE5YZBFZ.js → FormSpotlight-W4SXKKO6.js} +3 -3
  11. package/dist/{FormStage-OOPQC27J.js → FormStage-JTEE5MZD.js} +3 -3
  12. package/dist/ManagedForm-ZAUHIHGP.js +19 -0
  13. package/dist/{ManagedNewsletterForm-TC5542ZG.js → ManagedNewsletterForm-DQIB5Z4Y.js} +9 -6
  14. package/dist/{SignalCore-2YP5FCAS.js → SignalCore-W5PYYMGX.js} +7 -7
  15. package/dist/SiteChat-MY2GATWC.js +6 -0
  16. package/dist/SiteDesignReporter-ICZWEGCY.js +12 -0
  17. package/dist/SitePopups-TGULLAER.js +13 -0
  18. package/dist/SitemapSync-AN2OBJE6.js +9 -0
  19. package/dist/_client/booking-widget.js +6 -5
  20. package/dist/_client/testimonial-section.d.ts +1 -1
  21. package/dist/_client/testimonial-section.js +4 -2
  22. package/dist/affiliates/index.js +6 -6
  23. package/dist/analytics/index.js +73 -7
  24. package/dist/articles/index.js +2 -2
  25. package/dist/articles/server-ui.js +3 -3
  26. package/dist/articles/server.js +2 -2
  27. package/dist/brand.css +1 -1
  28. package/dist/chat/index.d.ts +1 -1
  29. package/dist/chat/index.js +39 -8
  30. package/dist/chunk-3G7YABRA.js +25 -0
  31. package/dist/{chunk-CGWUXUYZ.js → chunk-3RDJKIYO.js} +2 -2
  32. package/dist/{chunk-J4FSB4OG.js → chunk-3YKQLC7J.js} +5 -2
  33. package/dist/{chunk-BEBR4OJD.js → chunk-56VDS2RP.js} +2 -2
  34. package/dist/chunk-5ROTTMBL.js +19 -0
  35. package/dist/{chunk-56KNHB4U.js → chunk-5S2XDG5O.js} +1 -1
  36. package/dist/chunk-5TM3WPCI.js +7 -0
  37. package/dist/{chunk-BR4ZKUHH.js → chunk-6CJGZFOU.js} +18 -2
  38. package/dist/{chunk-RYVDGXC2.js → chunk-6KU7STM3.js} +3 -1
  39. package/dist/{chunk-XLSQTTUE.js → chunk-6QFINXLH.js} +3 -3
  40. package/dist/{chunk-CYUFBKJQ.js → chunk-6ZXJ3SXR.js} +1 -1
  41. package/dist/{chunk-NI2XNEMR.js → chunk-7YEEOIWI.js} +1 -1
  42. package/dist/{chunk-DNPNYWVL.js → chunk-BQ2CXKTQ.js} +5 -20
  43. package/dist/{chunk-X6F6SO4S.js → chunk-C7TLGL3R.js} +21 -1
  44. package/dist/{chunk-43OCZ3JA.js → chunk-CAH4Y4PY.js} +4 -2
  45. package/dist/chunk-CAT235HY.js +13 -0
  46. package/dist/{chunk-PXKIGZ2F.js → chunk-EATJPSTS.js} +1 -1
  47. package/dist/{chunk-O5RGXTWU.js → chunk-GNSXOTIK.js} +6 -4
  48. package/dist/{chunk-UPRSH6Q4.js → chunk-ICAVVF6D.js} +3 -3
  49. package/dist/{chunk-2ECWEUHP.js → chunk-IJQ767JS.js} +3 -5
  50. package/dist/{chunk-MKMD2HJW.js → chunk-J65N34YM.js} +3 -3
  51. package/dist/{chunk-6U3VLV2C.js → chunk-JIH32RH2.js} +4 -4
  52. package/dist/{chunk-T4DLETKR.js → chunk-K22OLAPC.js} +2 -2
  53. package/dist/{chunk-I2YX3HVD.js → chunk-KRBBH64S.js} +3 -3
  54. package/dist/{chunk-VF4F5WXZ.js → chunk-LBIQ5LTC.js} +1 -1
  55. package/dist/{chunk-WGIDC6QP.js → chunk-LKH44GI3.js} +5 -5
  56. package/dist/{chunk-ZTLMPUO6.js → chunk-LNSF6BJC.js} +1 -1
  57. package/dist/{chunk-WDQB4OXY.js → chunk-M62U7TJF.js} +1 -1
  58. package/dist/{chunk-EDYHROQ7.js → chunk-NFRJTOTB.js} +3 -3
  59. package/dist/chunk-OD2ULW5Z.js +57 -0
  60. package/dist/{chunk-Y6LP36UW.js → chunk-OE3NXEOF.js} +2 -2
  61. package/dist/{chunk-L7U23XI2.js → chunk-OGK7OL3T.js} +5 -4
  62. package/dist/{chunk-RDPW4D33.js → chunk-PD7K54EQ.js} +2 -2
  63. package/dist/{chunk-MVR4FY5R.js → chunk-PIX7FAMX.js} +2 -2
  64. package/dist/{chunk-2AD3CDRR.js → chunk-ROAOI6GG.js} +10 -10
  65. package/dist/{chunk-YJLS6JBI.js → chunk-S7SSYGUJ.js} +6 -5
  66. package/dist/{chunk-ZKHI4E2B.js → chunk-SBPAXWLF.js} +1 -1
  67. package/dist/{chunk-ZHS2XFLV.js → chunk-TOSZGJEQ.js} +1 -1
  68. package/dist/{chunk-4NTBQNHA.js → chunk-TYAVHRWH.js} +80 -81
  69. package/dist/{chunk-Z65DHMTW.js → chunk-TZ5RTANX.js} +3 -3
  70. package/dist/{chunk-VX5CMNMM.js → chunk-UAYAJPEP.js} +7 -1
  71. package/dist/{chunk-4YTYGG2C.js → chunk-URJN75ZG.js} +29 -16
  72. package/dist/{chunk-EPT6FJUY.js → chunk-UUWUAMUC.js} +13 -16
  73. package/dist/{chunk-PKGN32AU.js → chunk-XPTJRVL2.js} +1 -1
  74. package/dist/{chunk-662ILEZ6.js → chunk-Y35BWW2C.js} +3 -7
  75. package/dist/{chunk-MRQ2U4LZ.js → chunk-ZHNQFNO3.js} +2 -2
  76. package/dist/chunk-ZKADJNR2.js +52 -0
  77. package/dist/{chunk-WGG6GTKW.js → chunk-ZLFGXKLG.js} +1 -1
  78. package/dist/client/index.js +6 -5
  79. package/dist/contracts/entries.d.ts +1 -1
  80. package/dist/contracts/sentences.d.ts +46 -0
  81. package/dist/contracts/site-cache.d.ts +2 -0
  82. package/dist/cta-bar/index.js +1 -1
  83. package/dist/fleet/index.js +6 -5
  84. package/dist/forms/field-autocomplete.d.ts +16 -8
  85. package/dist/forms/index.d.ts +5 -0
  86. package/dist/forms/index.js +17 -17
  87. package/dist/forms/server.js +7 -7
  88. package/dist/forms/static.js +2 -2
  89. package/dist/forms/submitForm.d.ts +5 -0
  90. package/dist/images/index.js +4 -4
  91. package/dist/index.d.ts +3 -7
  92. package/dist/index.js +1 -1
  93. package/dist/layout/SiteKitLayout.d.ts +2 -1
  94. package/dist/layout/client.js +11 -9
  95. package/dist/layout/index.js +14 -12
  96. package/dist/llms/index.js +8 -7
  97. package/dist/maps/index.js +6 -6
  98. package/dist/mcp/sonor.d.ts +47 -3
  99. package/dist/mcp/sonor.js +31 -21
  100. package/dist/proxy/index.d.ts +3 -3
  101. package/dist/proxy/index.js +1 -1
  102. package/dist/reputation/TestimonialSection.d.ts +1 -1
  103. package/dist/reputation/VisualReviewCard.d.ts +6 -0
  104. package/dist/reputation/index.d.ts +2 -1
  105. package/dist/reputation/index.js +5 -2
  106. package/dist/reputation/review-photo.d.ts +2 -0
  107. package/dist/reputation/server.d.ts +3 -2
  108. package/dist/reputation/server.js +4 -1
  109. package/dist/reputation/types.d.ts +22 -0
  110. package/dist/revalidate/index.js +3 -3
  111. package/dist/robots/indexnow.js +2 -2
  112. package/dist/runtime/index.d.ts +32 -0
  113. package/dist/runtime/index.js +7 -0
  114. package/dist/seo/api.d.ts +0 -4
  115. package/dist/seo/client.js +6 -5
  116. package/dist/seo/getManagedMetadata.d.ts +24 -0
  117. package/dist/seo/index.d.ts +2 -3
  118. package/dist/seo/index.js +14 -132
  119. package/dist/seo/indexnow.js +2 -2
  120. package/dist/seo/llms.js +8 -7
  121. package/dist/seo/register-sitemap-cli.js +2 -2
  122. package/dist/seo/server-api.d.ts +0 -6
  123. package/dist/seo/server.d.ts +1 -1
  124. package/dist/seo/server.js +4 -4
  125. package/dist/seo/sitemap.js +5 -4
  126. package/dist/seo/types.d.ts +9 -30
  127. package/dist/server/index.d.ts +8 -1
  128. package/dist/server/index.js +5 -4
  129. package/dist/server/mint-site-token.d.ts +1 -13
  130. package/dist/server/server-fetch.d.ts +19 -0
  131. package/dist/server-api-EGOKC7Q3.js +9 -0
  132. package/dist/shared/build-entries.d.ts +21 -9
  133. package/dist/shared/clientApiConfig.d.ts +56 -0
  134. package/dist/shared/fresh-fetch.d.ts +9 -3
  135. package/dist/shared/identity-reader.d.ts +26 -0
  136. package/dist/shared/identity-storage.d.ts +30 -0
  137. package/dist/shared/identity.d.ts +13 -13
  138. package/dist/shared/import-specifiers.d.ts +26 -0
  139. package/dist/shared/sonorFetch.d.ts +4 -3
  140. package/dist/shared/version.d.ts +1 -1
  141. package/dist/signal/index.js +2 -2
  142. package/dist/sitemap/index.js +5 -4
  143. package/dist/slots/index.js +3 -3
  144. package/dist/sync/index.js +6 -5
  145. package/dist/types.d.ts +0 -1
  146. package/dist/website/cta-bar.js +1 -1
  147. package/dist/website/images.js +4 -4
  148. package/dist/website/index.js +7 -6
  149. package/dist/website/popups.js +10 -7
  150. package/dist/website/slots.js +3 -3
  151. package/dist/{writeLLMsTxt-2NQVDGYI.js → writeLLMsTxt-UZGN6IBU.js} +4 -3
  152. package/docs/MIGRATING-TO-7.md +5 -2
  153. package/docs/MIGRATING-TO-8.md +183 -0
  154. package/docs.json +4 -8
  155. package/package.json +15 -44
  156. package/skills/site-kit/SKILL.md +41 -11
  157. package/src/analytics/README.md +14 -14
  158. package/src/chat/README.md +7 -7
  159. package/src/forms/README.md +61 -6
  160. package/src/mcp/README.md +61 -20
  161. package/src/proxy/README.md +5 -4
  162. package/src/reputation/README.md +25 -0
  163. package/src/revalidate/README.md +2 -2
  164. package/src/runtime/README.md +51 -0
  165. package/src/seo/README.md +24 -8
  166. package/src/sync/README.md +2 -2
  167. package/src/website/README.md +3 -2
  168. package/dist/AnalyticsProvider-DJQA66AG.js +0 -11
  169. package/dist/ManagedForm-JRZAJ7SZ.js +0 -16
  170. package/dist/SiteChat-EGEZJJVV.js +0 -5
  171. package/dist/SiteDesignReporter-YEEWJKWN.js +0 -11
  172. package/dist/SitePopups-LQBIXIFV.js +0 -10
  173. package/dist/SitemapSync-LSZ2EYOF.js +0 -8
  174. package/dist/chunk-24QZEO3Q.js +0 -41
  175. package/dist/chunk-BU66S5B7.js +0 -1
  176. package/dist/chunk-G3NHWMP5.js +0 -233
  177. package/dist/chunk-HODO5BX5.js +0 -28
  178. package/dist/chunk-L3AQCDCY.js +0 -386
  179. package/dist/chunk-P5GB6NEO.js +0 -66
  180. package/dist/chunk-SWKE6FWH.js +0 -47
  181. package/dist/cms/CmsPage.d.ts +0 -17
  182. package/dist/cms/CmsPreview.d.ts +0 -37
  183. package/dist/cms/CmsSection.d.ts +0 -8
  184. package/dist/cms/PortableTextRenderer.d.ts +0 -7
  185. package/dist/cms/index.d.ts +0 -37
  186. package/dist/cms/index.js +0 -5
  187. package/dist/cms/sanity-image.d.ts +0 -47
  188. package/dist/cms/sections/CtaSection.d.ts +0 -3
  189. package/dist/cms/sections/CustomSection.d.ts +0 -7
  190. package/dist/cms/sections/FaqSection.d.ts +0 -3
  191. package/dist/cms/sections/FormSection.d.ts +0 -8
  192. package/dist/cms/sections/GallerySection.d.ts +0 -3
  193. package/dist/cms/sections/HeroSection.d.ts +0 -3
  194. package/dist/cms/sections/RichTextSection.d.ts +0 -3
  195. package/dist/cms/sections/TestimonialsSection.d.ts +0 -3
  196. package/dist/cms/sections/index.d.ts +0 -8
  197. package/dist/cms/server-api.d.ts +0 -49
  198. package/dist/cms/server.d.ts +0 -1
  199. package/dist/cms/server.js +0 -5
  200. package/dist/cms/types.d.ts +0 -104
  201. package/dist/commerce/CalendarView.d.ts +0 -43
  202. package/dist/commerce/CheckoutForm.d.ts +0 -11
  203. package/dist/commerce/EventCalendar.d.ts +0 -26
  204. package/dist/commerce/EventCheckout.d.ts +0 -42
  205. package/dist/commerce/EventEmbed.d.ts +0 -11
  206. package/dist/commerce/EventModal.d.ts +0 -43
  207. package/dist/commerce/EventTile.d.ts +0 -10
  208. package/dist/commerce/EventsAgenda.d.ts +0 -38
  209. package/dist/commerce/EventsWidget.d.ts +0 -84
  210. package/dist/commerce/OfferingCard.d.ts +0 -9
  211. package/dist/commerce/OfferingList.d.ts +0 -9
  212. package/dist/commerce/ProductDetail.d.ts +0 -38
  213. package/dist/commerce/ProductEmbed.d.ts +0 -11
  214. package/dist/commerce/ProductGrid.d.ts +0 -41
  215. package/dist/commerce/ProductPage.d.ts +0 -39
  216. package/dist/commerce/RegistrationForm.d.ts +0 -9
  217. package/dist/commerce/SizeChart.d.ts +0 -8
  218. package/dist/commerce/UpcomingEvents.d.ts +0 -9
  219. package/dist/commerce/api.d.ts +0 -179
  220. package/dist/commerce/events-extras.d.ts +0 -60
  221. package/dist/commerce/index.d.ts +0 -33
  222. package/dist/commerce/index.js +0 -8022
  223. package/dist/commerce/server.d.ts +0 -161
  224. package/dist/commerce/server.js +0 -2
  225. package/dist/commerce/types.d.ts +0 -340
  226. package/dist/commerce/useEventModal.d.ts +0 -20
  227. package/dist/commerce/utils.d.ts +0 -17
  228. package/dist/engage/EngageWidget.d.ts +0 -21
  229. package/dist/engage/index.d.ts +0 -14
  230. package/dist/engage/index.js +0 -45
  231. package/dist/engage/types.d.ts +0 -33
  232. package/dist/seo/ManagedContent.d.ts +0 -14
  233. package/dist/server-api-BVCBLJKL.js +0 -9
  234. package/dist/website/cms/server.d.ts +0 -2
  235. package/dist/website/cms/server.js +0 -5
  236. package/dist/website/cms-server.d.ts +0 -2
  237. package/dist/website/cms.d.ts +0 -2
  238. package/dist/website/cms.js +0 -5
  239. package/src/commerce/README.md +0 -109
package/AGENTS.md CHANGED
@@ -1,8 +1,8 @@
1
- # Integrating a site with Sonor — agent guide
1
+ # Integrating a site with Sonor: agent guide
2
2
 
3
3
  > **You installed `@sonordev/site-kit`.** This file tells a coding agent how to
4
- > wire a Next.js site to Sonor correctly and prove it works — no web access
5
- > needed. **Editing site-kit itself?** See `CONTRIBUTING.md`.
4
+ > wire a Next.js site to Sonor correctly and prove it works, with no web
5
+ > access needed. **Editing site-kit itself?** See `CONTRIBUTING.md`.
6
6
 
7
7
  For the full machine-readable contract (modules, env, blessed patterns, failure
8
8
  modes, exit codes) run:
@@ -16,7 +16,7 @@ Everything below is also in that manifest. This file is the human-skimmable vers
16
16
  ## North star
17
17
 
18
18
  Take a bare Next.js repo → a fully wired, **verified-green** Sonor site. The
19
- signal that you are done is `verify` exiting 0 — not "the command ran."
19
+ signal that you're done is `verify` exiting 0, not "the command ran."
20
20
 
21
21
  ## Canonical sequence
22
22
 
@@ -28,6 +28,9 @@ npx sonor-setup mcp --yes --json # agent tools: MCP
28
28
  # Existing 2.x-6.x site? migrate deterministically:
29
29
  npx sonor-setup codemod --check --json # exit 1 ⇒ work pending
30
30
  npx sonor-setup codemod --write --json # apply (idempotent, minimal diffs)
31
+ # 7.x site that imports commerce? One more hop (commerce moved to @sonordev/commerce-kit):
32
+ npx sonor-setup codemod --only site-kit-8 --write --json # swaps the package name in its imports
33
+ pnpm install # the codemod edits package.json, not node_modules (or npm / yarn)
31
34
  next build # you run the build
32
35
  npx sonor-setup verify --json # exit 0 === done
33
36
  ```
@@ -38,7 +41,7 @@ npx sonor-setup verify --json # exit 0 === done
38
41
  envelope to stdout (all human logs go to stderr). Parse stdout; branch on
39
42
  `exitCode` / `ok` / `checks`.
40
43
  - **Exit codes:** `0` OK · `1` FAILED (result is red, fix the code) · `2` USAGE
41
- (bad invocation) · `3` CONFIG (missing input — the error names the flag) · `4`
44
+ (bad invocation) · `3` CONFIG (missing input; the error names the flag) · `4`
42
45
  NETWORK (API/key) · `5` INTERNAL.
43
46
  - **Never interactive under `--json`, `--yes`, or a non-TTY.** A command that
44
47
  needs input exits `3` with an actionable `fix` instead of hanging.
@@ -50,17 +53,17 @@ npx sonor-setup verify --json # exit 0 === done
50
53
  The **only** variable a site needs is:
51
54
 
52
55
  ```bash
53
- SONOR_API_KEY=sonor_1a2b3c4d_... # server-side only — NO NEXT_PUBLIC_ prefix
56
+ SONOR_API_KEY=sonor_1a2b3c4d_... # server-side only, NO NEXT_PUBLIC_ prefix
54
57
  ```
55
58
 
56
59
  `SiteKitLayout` reads it server-side and derives the project id + all client
57
60
  config. **Never** add `NEXT_PUBLIC_SONOR_API_KEY`, `UPTRADE_API_KEY`,
58
- `NEXT_PUBLIC_UPTRADE_API_KEY`, or `SONOR_PROJECT_ID`. Uptrade keys/vars are fully
59
- deprecated. Key format: `sonor_{project-uuid-first8}_{secret}`.
61
+ `NEXT_PUBLIC_UPTRADE_API_KEY`, or `SONOR_PROJECT_ID`. Pre-rebrand keys and
62
+ variables are fully deprecated. Key format: `sonor_{project-uuid-first8}_{secret}`.
60
63
 
61
64
  ## Blessed patterns
62
65
 
63
- **Root layout — `SiteKitLayout` (a server component), wrap `{children}`:**
66
+ **Root layout: `SiteKitLayout` (a server component), wrap `{children}`:**
64
67
 
65
68
  ```tsx
66
69
  import { SiteKitLayout } from '@sonordev/site-kit/layout'
@@ -95,7 +98,7 @@ wrap around `{children}` that skips server rendering, usually
95
98
  a hand-rolled deferred sibling was the workaround for site-kit <3.0.2. On those
96
99
  installs, upgrade.
97
100
 
98
- **Agent tools — the built-in Sonor MCP server (7.0).** Don't hand-write
101
+ **Agent tools: the built-in Sonor MCP server (7.0).** Don't hand-write
99
102
  business-info, FAQ or review tools; `npx sonor-setup mcp` wires
100
103
  `sonorMcpServer` from `@sonordev/site-kit/mcp/sonor`, and a site's own tools
101
104
  go in its `tools` array. `send_inquiry` needs the person's go-ahead
@@ -109,6 +112,30 @@ and so should you; add reporting to it rather than replacing it.
109
112
  `/website/images`, `/seo/llms`), never the root, which is types-only. The
110
113
  package is ESM only.
111
114
 
115
+ **Commerce and memberships (8.0).** Commerce isn't in site-kit any more, and
116
+ memberships is new and ships only in commerce-kit. Products, services, events,
117
+ checkout and memberships are
118
+ [`@sonordev/commerce-kit`](https://sonor.dev/commerce-kit), which builds on
119
+ site-kit and releases on its own. Install it beside site-kit and import from
120
+ `@sonordev/commerce-kit/commerce`, `/commerce/server`, `/memberships` or
121
+ `/memberships/server`; its root entry is types-only (`CommerceOffering` and the
122
+ other commerce types). The old site-kit commerce entries are gone, so don't
123
+ import commerce from site-kit; `npx sonor-setup manifest --json` lists every
124
+ moved subpath under `relocated`, the types the root used to export under
125
+ `relocatedTypes`, and what was retired for good under `removed`. A 7.x site
126
+ that sells moves with
127
+ `npx sonor-setup codemod --only site-kit-8 --write` (the guide is
128
+ [Moving a site to site-kit 8](docs/MIGRATING-TO-8.md)). The opt-in
129
+ `list_offerings` agent tool needs a reader since 8.0:
130
+ `sonorMcpServer({ businessName, offerings: { path: '/shop', read: getOfferingsResult } })`,
131
+ with `getOfferingsResult` from `@sonordev/commerce-kit/commerce/server`.
132
+
133
+ **Building a package on top of site-kit** (a kit, as commerce-kit is)? Take the
134
+ browser transport from `@sonordev/site-kit/runtime` (`sonorFetch`,
135
+ `getClientApiConfig`) and server data from `@sonordev/site-kit/server`, and
136
+ don't read `window.__SITE_KIT_*` or call `fetch` on the Sonor API yourself. List
137
+ site-kit as a peer dependency. See [Building a kit](src/runtime/README.md).
138
+
112
139
  ## Common failure modes → the check that catches it
113
140
 
114
141
  | Symptom | Cause | Fix | `doctor`/`verify` check |
@@ -118,7 +145,8 @@ package is ESM only.
118
145
  | Invalid-key console spam; data features paused (401/403) | Stale/rotated key, or an env change wasn't redeployed | Put the current `sonor_` key in `.env.local` and redeploy | `key.valid` |
119
146
  | Deprecated `SiteKitProvider` in layout | 2.x integration | `npx sonor-setup codemod --only provider-to-layout --write` | `layout.sitekit` |
120
147
  | `@uptrademedia/site-kit` / `UPTRADE_*` remnants | pre-rebrand site | `npx sonor-setup codemod --only uptrade-to-sonor --write` | `package.installed` / `env.api-key` |
121
- | Hero present but LCP late | above-the-fold element is `opacity:0` + JS entrance-animated | Render hero fully static; gate reveal animations below the fold | — |
148
+ | Hero present but LCP late | above-the-fold element is `opacity:0` + JS entrance-animated | Render hero fully static; gate reveal animations below the fold | none |
149
+ | Build can't resolve a site-kit commerce path (`Can't resolve '@sonordev/site-kit/commerce'`, or `Package subpath './commerce' is not defined by "exports"`) | The site is on site-kit 8, where commerce moved to `@sonordev/commerce-kit` | `npm install @sonordev/commerce-kit`, then `npx sonor-setup codemod --only site-kit-8 --write`, then build | none |
122
150
 
123
151
  ## Verifying (definition of done)
124
152
 
@@ -128,5 +156,5 @@ npx sonor-setup verify --url https://your-site.com --json # SSR check against
128
156
  ```
129
157
 
130
158
  `verify` exits `0` only when the integration is genuinely green. If it exits
131
- non-zero, read `checks[]` — each red check carries a `fix` (and often a
159
+ non-zero, read `checks[]`; each red check carries a `fix` (and often a
132
160
  `fixCommand`), and `nextSteps[]` names what to run. Loop until green.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,78 @@
1
1
  # @sonordev/site-kit Changelog
2
2
 
3
+ ## 8.0.0
4
+
5
+ Two things leave site-kit in this release. Commerce (products, services, events and checkout) and the new memberships module move into their own package, [`@sonordev/commerce-kit`](https://sonor.dev/commerce-kit), which versions and releases on its own. And the entries for the modules Sonor retired, Engage and the Sanity CMS, are removed, as the 7.0, 7.1 and 7.2 notes said they'd be. A site that uses neither changes nothing: update site-kit and rebuild.
6
+
7
+ The commerce move is about release independence and package surface, not bundle size. site-kit's root entry was already types-only and no core entry referenced commerce, so visitors to a site without commerce never downloaded any of it. What changes is that checkout, the busiest money path on a site, can ship a fix without a site-kit release, and site-kit's package is about 8% smaller to download and about 13% smaller on disk than 7.4.0.
8
+
9
+ ### Breaking: commerce moved to commerce-kit
10
+
11
+ `@sonordev/site-kit/commerce` and `@sonordev/site-kit/commerce/server` are removed, and the root entry no longer re-exports the commerce types. Nothing is left behind at the old paths, so an import you miss fails the build. The subpath stays the same, so it's a swap of the package name:
12
+
13
+ | Was | Now |
14
+ |---|---|
15
+ | `@sonordev/site-kit/commerce` | `@sonordev/commerce-kit/commerce` |
16
+ | `@sonordev/site-kit/commerce/server` | `@sonordev/commerce-kit/commerce/server` |
17
+ | Commerce types imported from the root, `@sonordev/site-kit` | `@sonordev/commerce-kit` |
18
+
19
+ The root types were `CommerceOffering`, `CommerceCategory`, `CommerceVariant`, `CommerceSchedule`, `OfferingType`, `Cart`, `CartItem`, `EventCheckoutProps` and `CheckoutLineItem`. Install `@sonordev/commerce-kit` beside site-kit 8; it lists site-kit 8 or newer as a peer dependency.
20
+
21
+ The codemod (sonor-setup 7.3.0 or later) does the swap. `npx sonor-setup codemod --only site-kit-8` shows what it would change and writes nothing; add `--write` to apply it. It rewrites the imports, then adds `@sonordev/commerce-kit` to package.json and raises site-kit's range to `^8.0.0` when your code imports commerce, and it flags anything it can't rewrite safely, such as an `offerings` option with no reader. Then install and build. The full guide is [docs/MIGRATING-TO-8.md](docs/MIGRATING-TO-8.md).
22
+
23
+ The new entries export what the old ones did, under the same names, and your styles still apply: the components keep their `site-kit-` class names, and brand tokens still come from site-kit's `brand.css`, which your site imports as before. A few things behave better, all listed in [commerce-kit's changelog](https://sonor.dev/commerce-kit/changelog): the shopping events now reach Sonor, server helpers return whole offerings and cache them under a tag Sonor expires when you edit, and a product marked sold out keeps its page. In your server log, a failed fetch starts with `[commerce-kit]` instead of `[site-kit/commerce]`.
24
+
25
+ Memberships is new in this release and ships only in commerce-kit; it was never part of a site-kit release. See [Memberships](https://sonor.dev/commerce-kit/memberships).
26
+
27
+ ### Breaking: the retired Engage and CMS entries are removed
28
+
29
+ Both modules were retired in Sonor, nothing renders from them any more, and their entries were kept through 7.x so old imports kept building. They're gone, with nothing to replace them:
30
+
31
+ - **`@sonordev/site-kit/engage`.** Website chat is `@sonordev/site-kit/chat` and popups are `@sonordev/site-kit/website/popups`. `npx sonor-setup codemod --write` moves each name that has a home there and flags the rest (`EngageWidget`, which `SiteKitLayout` already mounts for you). The deprecated type names the root re-exported from it (`EngageElement`, `WidgetConfig` and the rest) are gone too: use `SitePopup` and `SitePopupConfig`.
32
+ - **`@sonordev/site-kit/cms`, `/cms/server`, `/website/cms` and `/website/cms/server`,** with their optional peer dependencies `@portabletext/react` and `@sanity/image-url`, which you can uninstall. No project has CMS pages and Sonor no longer serves them. Site copy is managed copy: `ManagedSlot`, `ManagedRichText`, `ManagedLink` and `ManagedList` from `@sonordev/site-kit/website/slots`.
33
+ - **`ManagedContent`, `getManagedContentData` and `getContentBlock`** from `@sonordev/site-kit/seo`, and their types. Content blocks are retired for the same reason; use `ManagedRichText`.
34
+
35
+ The codemod flags an import of any of these with the fix, and `npx sonor-setup manifest --json` lists them under `removed`. Nothing else changes for a site that never imported them.
36
+
37
+ ### MCP: offerings need a reader
38
+
39
+ `list_offerings`, the opt-in agent tool for priced products, services and events, used to read commerce directly. It takes its reader as an option now, so site-kit doesn't depend on commerce-kit. The tool, its ranking and its rule that a private price is never shown stay in site-kit.
40
+
41
+ ```ts
42
+ // 7.x
43
+ sonorMcpServer({ businessName: 'Example Studio', offerings: { path: '/shop' } })
44
+
45
+ // 8.0
46
+ import { getOfferingsResult } from '@sonordev/commerce-kit/commerce/server'
47
+
48
+ sonorMcpServer({ businessName: 'Example Studio', offerings: { path: '/shop', read: getOfferingsResult } })
49
+ ```
50
+
51
+ `getOfferingsResult` reports a failed request as "the catalog is unavailable"; the plain `getOfferings` also works, but it reads an outage as an empty catalog. A site that doesn't pass `offerings` changes nothing, and `list_services` is unchanged (it reads core data). Without `read`, `sonorMcpServer` throws when the server is built, with a message that says what to pass. See [MCP and agent tools](src/mcp/README.md).
52
+
53
+ ### New: `@sonordev/site-kit/runtime`
54
+
55
+ The browser transport and API-address reader that packages built on site-kit share: `sonorFetch` (the site credential, retries with a timeout, one token refresh, and a pause after an authentication failure) and `getClientApiConfig`, plus `readAnalyticsIdentity` for the visitor's analytics ids. commerce-kit is built on it, and it's public API under semver. A site doesn't need to import it, since forms, analytics and the other modules already go through it. See [Building a kit](src/runtime/README.md).
56
+
57
+ ### What isn't affected
58
+
59
+ A site that doesn't import commerce, one of the removed entries, or pass `offerings` to `sonorMcpServer` changes nothing. The other deprecated paths from 7 still work, because sites still import them: `./middleware` (with `createMiddleware`), `./sitemap`, `./robots`, `./redirects`, `./og`, `./llms`, `./images`, `./slots`, `./landing` and `./cta-bar`, plus `SiteKitLayout`'s `engage` prop and the options that are accepted and ignored. Earlier notes said they'd go in 8.0; they stay until sites have moved off them, and will go in a later major. `npx sonor-setup codemod --write` moves a site onto the new homes whenever you like.
60
+
61
+ ### Also
62
+
63
+ - **SEO: pages get a self-referencing canonical by default** (`alternates.canonical './'`, resolved against `metadataBase`) when Sonor has none set. `getManagedMetadata` takes a new `scope: 'layout'` option, so a root or shared layout doesn't hand one path's managed canonical and hreflang to every route beneath it, and `alternates` now merge key by key (in `getManagedMetadata` and `withManagedMetadata`), so a page that sets only `languages` keeps its canonical. See [Canonical URLs](src/seo/README.md#canonical-urls).
64
+ - **Server fetches let Next steer the render.** `serverApiFetch` caught the errors Next throws on purpose (a page turning dynamic during the build, `redirect()`, `notFound()`) like failed requests: it retried them and then returned nothing, so such a page could be built with no data. It passes them on now. Kits that make their own server calls get the same check as `isNextControlFlow` from `@sonordev/site-kit/server`, which also exports `SITE_CACHE_TAGS`, the cache tags Sonor expires through [Live updates](src/revalidate/README.md). There's a new one, `commerce`, for products, events and membership plans.
65
+ - **Pages keep working when the browser blocks site storage.** The visitor and session ids are set up while the page first renders, and a browser set to block site data threw an error right there, which could break the whole page. The ids now stay in memory for that page instead, and forms, popups and analytics carry on with them.
66
+ - Browser modules read the Sonor API address and site credential from one place. During server rendering, booking, Signal and the form helpers now follow `SONOR_API_URL` like forms already did, so a staging site's server-rendered URLs point at staging. commerce-kit gets the same behavior through `@sonordev/site-kit/runtime`.
67
+ - **Autocomplete tokens for forms you draw yourself.** `autocompleteFor` is now exported from `@sonordev/site-kit/forms`. A form built with `useForm` can set `autoComplete={autocompleteFor(field)}` on its own controls and get the same token a `ManagedForm` control gets (`given-name`, `email`, `tel` and so on, or none when a field has no confident match), so a custom form no longer needs a list of its own. The type of its argument is exported as `AutocompleteField`. See [Autocomplete on your own controls](src/forms/README.md#autocomplete-on-your-own-controls).
68
+ - **The `stage` form layout meets WCAG AA contrast.** Its step numbers and the labels of answered steps measured between 3.4:1 and 4:1 against white, under the 4.5:1 AA asks for small text; they sit at about 5:1 now, and are still quieter than an open step's label.
69
+
70
+ ## 7.4.0
71
+
72
+ - Reviews can include a project-managed photo, caption, and alternative text. Text-only reviews remain visible while imagery is pending for Broadcast.
73
+ - `VisualReviewCard` and `VisualReviewGallery` are available from the server-safe reputation entry point. `TestimonialSection` also displays attached review photos.
74
+ - Token minting supports a cold Next.js Cache Components prerender, including the default 404 page. Each mint stays fresh across deploys and token expiry, without changing form initialization or putting a raw API key into successful token responses.
75
+
3
76
  ## 7.3.0
4
77
 
5
78
  AI assistants can discover a site's existing MCP tools through more of the surfaces they read.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @sonordev/site-kit
2
2
 
3
- All-in-one integration kit for [Sonor](https://sonor.io)-powered Next.js sites. One package, one env var, every module: SEO, Analytics, Forms, Articles, Commerce, Website chat, Popups, GEO/AEO, Booking, Reputation, A/B Testing, and more — all managed from the Sonor dashboard at [app.sonor.io](https://app.sonor.io).
3
+ All-in-one integration kit for [Sonor](https://sonor.io)-powered Next.js sites. One package, one env var, and the modules a site needs: SEO, Analytics, Forms, Articles, Website chat, Popups, GEO/AEO, Booking, Reputation, A/B Testing, and more, all managed from the Sonor dashboard at [app.sonor.io](https://app.sonor.io). Products, events and memberships come from the companion package [`@sonordev/commerce-kit`](https://sonor.dev/commerce-kit), which builds on site-kit.
4
4
 
5
5
  ## Install
6
6
 
@@ -8,6 +8,14 @@ All-in-one integration kit for [Sonor](https://sonor.io)-powered Next.js sites.
8
8
  npm install @sonordev/site-kit
9
9
  ```
10
10
 
11
+ Selling products, events or memberships? Add the companion package too: `npm install @sonordev/commerce-kit`. See [Commerce and memberships](#commerce-and-memberships).
12
+
13
+ ## What's new in 8.0
14
+
15
+ - **Commerce and memberships are their own package.** Products, services, events, checkout and the new memberships module now live in [`@sonordev/commerce-kit`](https://sonor.dev/commerce-kit), which builds on site-kit and releases on its own. A site that doesn't sell anything changes nothing. A site that does swaps the package name in its imports: `npx sonor-setup codemod --only site-kit-8 --write`, then install and build. See [docs/MIGRATING-TO-8.md](docs/MIGRATING-TO-8.md).
16
+ - **The retired Engage and CMS entries are removed,** as the 7.x notes said: `@sonordev/site-kit/engage`, `/cms` and `/website/cms`, and `ManagedContent` with its data helpers. A site that never imported them changes nothing. The deprecated aliases for renamed modules (`./middleware`, `./og`, `./llms` and the rest) still work.
17
+ - **A documented entry for kits.** [`@sonordev/site-kit/runtime`](src/runtime/README.md) is the browser transport and API-address reader that packages like commerce-kit build on.
18
+
11
19
  ## What's new in 7.0
12
20
 
13
21
  - **Agents can use the site.** `npx sonor-setup mcp` serves the built-in
@@ -75,7 +83,7 @@ export const config = {
75
83
 
76
84
  Handles Sonor-managed redirects, security headers, and AI discovery headers.
77
85
 
78
- **CLI (optional — scaffolds everything):**
86
+ **CLI (optional, scaffolds everything):**
79
87
 
80
88
  ```bash
81
89
  npx sonor-setup init
@@ -97,7 +105,7 @@ Every module has its own README in `src/<module>/README.md` with full API docs,
97
105
  | **SEO** | `@sonordev/site-kit/seo` | Managed metadata, schemas, FAQs, internal links | [README](src/seo/README.md) |
98
106
  | **Analytics** | `@sonordev/site-kit/analytics` | Page views, events, conversions, Web Vitals | [README](src/analytics/README.md) |
99
107
  | **Sitemap** | `@sonordev/site-kit/seo/sitemap` | Auto-generated sitemap with Sonor sync. URLs follow next.config `trailingSlash` | [README](src/sitemap/README.md) |
100
- | **Proxy** | `@sonordev/site-kit/proxy` | Redirects, security headers, AI discovery (`./middleware` is its 7.x alias) | [README](src/proxy/README.md) |
108
+ | **Proxy** | `@sonordev/site-kit/proxy` | Redirects, security headers, AI discovery (`./middleware` is a deprecated alias) | [README](src/proxy/README.md) |
101
109
  | **Redirects** | `@sonordev/site-kit/seo/redirects` | Sonor-managed 301/302 redirect rules | [README](src/redirects/README.md) |
102
110
 
103
111
  ### Content
@@ -115,14 +123,19 @@ Every module has its own README in `src/<module>/README.md` with full API docs,
115
123
  | **Website chat** | `@sonordev/site-kit/chat` | The chat launcher and Echo (Sonor → Messages) | [README](src/chat/README.md) |
116
124
  | **Popups & Banners** | `@sonordev/site-kit/website/popups` | Popups, banners and toasts from Sonor → Website, drawn in the site's own design | [README](src/website/README.md) |
117
125
  | **Forms** | `@sonordev/site-kit/forms` | Managed forms with CRM routing, multi-step, validation | [README](src/forms/README.md) |
126
+ | **Sync** | `@sonordev/site-kit/sync` | Booking/scheduling widget (Calendly-like) | [README](src/sync/README.md) |
118
127
  | **Signal** | `@sonordev/site-kit/signal` | A/B experiments, behavior tracking, real-time config | [README](src/signal/README.md) |
119
128
 
120
- ### Commerce
129
+ ### Commerce and memberships
130
+
131
+ Products, services, events, checkout and memberships live in [`@sonordev/commerce-kit`](https://sonor.dev/commerce-kit), which builds on site-kit and releases on its own. Install it beside site-kit: `npm install @sonordev/commerce-kit`. Each module also has a `/server` entry for server components and route handlers.
121
132
 
122
133
  | Module | Import | Purpose | Docs |
123
134
  |--------|--------|---------|------|
124
- | **Commerce** | `@sonordev/site-kit/commerce` | Products, services, events, checkout | [README](src/commerce/README.md) |
125
- | **Sync** | `@sonordev/site-kit/sync` | Booking/scheduling widget (Calendly-like) | [README](src/sync/README.md) |
135
+ | **Commerce** | `@sonordev/commerce-kit/commerce` | Products, services, events, checkout | [Docs](https://sonor.dev/commerce-kit/commerce) |
136
+ | **Memberships** | `@sonordev/commerce-kit/memberships` | Sell a membership and let members in | [Docs](https://sonor.dev/commerce-kit/memberships) |
137
+
138
+ Upgrading a site that imports commerce from site-kit? That entry moved in 8.0: see [Moving a site to site-kit 8](docs/MIGRATING-TO-8.md).
126
139
 
127
140
  ### GEO / AEO (AI Visibility)
128
141
 
@@ -135,13 +148,13 @@ Every module has its own README in `src/<module>/README.md` with full API docs,
135
148
 
136
149
  ### Motion
137
150
 
138
- Three tiers as three subpaths — a site only installs and ships what it imports. Server HTML always stays visible; above-the-fold content is never animated in.
151
+ Three tiers as three subpaths: a site only installs and ships what it imports. Server HTML always stays visible; above-the-fold content is never animated in.
139
152
 
140
153
  | Module | Import | Purpose | Docs |
141
154
  |--------|--------|---------|------|
142
- | **Motion** | `@sonordev/site-kit/motion` | `<Reveal>`, `<Parallax>`, `<ScrollScene>` and the scroll engine — zero deps, ~2KB | [README](src/motion/README.md) |
143
- | **Motion / GSAP** | `@sonordev/site-kit/motion/gsap` | Lazy-loaded GSAP timelines (`useGsap`) — optional peer `gsap` | [README](src/motion/README.md) |
144
- | **Motion / three** | `@sonordev/site-kit/motion/three` | WebGL stages on the engine (`useThreeStage`) — optional peer `three` | [README](src/motion/README.md) |
155
+ | **Motion** | `@sonordev/site-kit/motion` | `<Reveal>`, `<Parallax>`, `<ScrollScene>` and the scroll engine; zero deps, ~2KB | [README](src/motion/README.md) |
156
+ | **Motion / GSAP** | `@sonordev/site-kit/motion/gsap` | Lazy-loaded GSAP timelines (`useGsap`); optional peer `gsap` | [README](src/motion/README.md) |
157
+ | **Motion / three** | `@sonordev/site-kit/motion/three` | WebGL stages on the engine (`useThreeStage`); optional peer `three` | [README](src/motion/README.md) |
145
158
 
146
159
  ### Liquid Glass chrome
147
160
 
@@ -151,6 +164,12 @@ Three tiers as three subpaths — a site only installs and ships what it imports
151
164
 
152
165
  Echo's launcher and chat window use the same glass recipe; see [Website chat](src/chat/README.md#liquid-glass-610).
153
166
 
167
+ ### For kits built on site-kit
168
+
169
+ | Module | Import | Purpose | Docs |
170
+ |--------|--------|---------|------|
171
+ | **Runtime** | `@sonordev/site-kit/runtime` | The browser transport (`sonorFetch`) and API-address reader that packages like commerce-kit build on. A site doesn't need it | [README](src/runtime/README.md) |
172
+
154
173
  ---
155
174
 
156
175
  ## How It Works
@@ -199,12 +218,15 @@ import { AnalyticsProvider, useAnalytics, WebVitals } from '@sonordev/site-kit/a
199
218
  // Forms
200
219
  import { ManagedForm, useForm, formsApi, field } from '@sonordev/site-kit/forms'
201
220
 
202
- // Articles (server components — keeps server-only data helpers out of client bundles)
221
+ // Articles (server components; keeps server-only data helpers out of client bundles)
203
222
  import { Article, ArticleList, ClusterLandingPage } from '@sonordev/site-kit/articles/server-ui'
204
223
  import { getArticle, generateArticleStaticParams } from '@sonordev/site-kit/articles/server'
205
224
 
206
- // Commerce
207
- import { OfferingCard, ProductPage, EventCalendar } from '@sonordev/site-kit/commerce'
225
+ // Commerce and memberships are their own package: npm install @sonordev/commerce-kit
226
+ import { OfferingCard, ProductPage, EventCalendar } from '@sonordev/commerce-kit/commerce'
227
+ import { getOfferingBySlug } from '@sonordev/commerce-kit/commerce/server'
228
+ import { MembershipCheckoutButton } from '@sonordev/commerce-kit/memberships'
229
+ import type { CommerceOffering } from '@sonordev/commerce-kit'
208
230
 
209
231
  // Booking
210
232
  import { BookingWidget } from '@sonordev/site-kit/sync'
@@ -240,7 +262,7 @@ import { handleManagedRedirects } from '@sonordev/site-kit/seo/redirects'
240
262
  // Robots (the AI crawler helpers live in /llms; /robots re-exports them)
241
263
  import { createRobots, buildAiCrawlerRules, createRobotsTxtHandler } from '@sonordev/site-kit/seo/robots'
242
264
 
243
- // Motion (tier 0, zero deps) — tiers 1/2 need `npm i gsap` / `npm i three`
265
+ // Motion (tier 0, zero deps); tiers 1/2 need `npm i gsap` / `npm i three`
244
266
  import { Reveal, Parallax, ScrollScene, registerScene } from '@sonordev/site-kit/motion'
245
267
  import { useGsap } from '@sonordev/site-kit/motion/gsap'
246
268
  import { useThreeStage, canRunWebGL } from '@sonordev/site-kit/motion/three'
@@ -248,6 +270,9 @@ import { useThreeStage, canRunWebGL } from '@sonordev/site-kit/motion/three'
248
270
  // Liquid Glass mobile CTA bar (server component; pass Next Link via `as`)
249
271
  import { CtaBar, CtaBarAction } from '@sonordev/site-kit/website/cta-bar'
250
272
 
273
+ // Building a package on site-kit (a kit, like commerce-kit): the browser transport
274
+ import { sonorFetch, getClientApiConfig } from '@sonordev/site-kit/runtime'
275
+
251
276
  // Styles (optional)
252
277
  import '@sonordev/site-kit/brand.css'
253
278
  import '@sonordev/site-kit/forms/styles.css'
@@ -258,7 +283,7 @@ import '@sonordev/site-kit/forms/styles.css'
258
283
  ## Environment Variables
259
284
 
260
285
  ```bash
261
- # Required (server-only — SiteKitLayout injects into client automatically):
286
+ # Required (server-only; SiteKitLayout injects into client automatically):
262
287
  SONOR_API_KEY=sonor_xxxxxxxx_xxxxx
263
288
 
264
289
  # Optional:
@@ -268,7 +293,7 @@ REVALIDATION_SECRET=your_secret # On-demand ISR for llms.txt
268
293
  MCP_TRANSPORT_SECRET=... # Netlify MCP relay (npx sonor-setup mcp writes it)
269
294
  ```
270
295
 
271
- Uptrade-era variables (`UPTRADE_API_KEY`, `NEXT_PUBLIC_UPTRADE_API_KEY`) aren't read, and `uptrade_` keys aren't accepted. A site that only sets those runs with no key. Move it to `SONOR_API_KEY` with `npx sonor-setup codemod --only uptrade-to-sonor --write`.
296
+ The pre-rebrand variables (`UPTRADE_API_KEY`, `NEXT_PUBLIC_UPTRADE_API_KEY`) aren't read, and keys with the old `uptrade_` prefix aren't accepted. A site that only sets those runs with no key. Move it to `SONOR_API_KEY` with `npx sonor-setup codemod --only uptrade-to-sonor --write`.
272
297
 
273
298
  ---
274
299
 
@@ -312,19 +337,20 @@ Fully typed. All types are exported from their respective module paths:
312
337
  import type { LLMsDataResponse, GenerateLLMSTxtOptions } from '@sonordev/site-kit/seo/llms'
313
338
  import type { ManagedFormConfig, UseFormReturn } from '@sonordev/site-kit/forms'
314
339
  import type { Article, TopicCluster } from '@sonordev/site-kit/articles'
315
- import type { CommerceOffering, SizeChart } from '@sonordev/site-kit/commerce'
316
340
  import type { SiteKitLayoutProps } from '@sonordev/site-kit/layout'
341
+ import type { CommerceOffering } from '@sonordev/commerce-kit' // commerce types live in commerce-kit
317
342
  ```
318
343
 
319
344
  ---
320
345
 
321
346
  ## Architecture Note
322
347
 
323
- `@sonordev/site-kit` is the client bridge between Next.js marketing sites and the Sonor platform. All persistent data (forms, articles, SEO config, analytics) lives in Sonor — site-kit fetches, renders, and tracks.
348
+ `@sonordev/site-kit` is the client bridge between Next.js marketing sites and the Sonor platform. All persistent data (forms, articles, SEO config, analytics) lives in Sonor; site-kit fetches, renders, and tracks.
324
349
 
325
350
  - **Server components** (SEO, Articles, Images): Import directly, RSC-compatible, no provider needed
326
351
  - **Client modules** (Analytics, chat, popups, Signal): Lazy-loaded via `SiteKitLayout`, tree-shaken
327
352
  - **Build-time** (Sitemap, llms.txt): Run during `next build`, sync to Sonor
328
353
  - **Middleware** (Redirects, Security, AI Discovery): Runs on every request edge
354
+ - **Kits** (commerce-kit): Packages that build on site-kit's public entries (`runtime`, `analytics`, `server`) and release on their own
329
355
 
330
356
  Full docs for every module: [sonor.dev](https://sonor.dev).
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@sonordev/site-kit",
4
- "version": "7.3.0",
4
+ "version": "8.0.0",
5
5
  "description": "Machine-readable manifest for coding agents integrating a site with Sonor. See AGENTS.md (shipped) and docs/SITE-KIT-AGENT-NATIVE.md.",
6
6
  "env": {
7
7
  "required": [
@@ -27,7 +27,7 @@
27
27
  "npx sonor-setup manifest --json",
28
28
  "npx sonor-setup init --api-key $SONOR_API_KEY --yes --json",
29
29
  "npx sonor-setup scaffold --yes --json",
30
- "npx sonor-setup codemod --check --json # an existing 2.x–6.x site → migrate (--write) if exit 1",
30
+ "npx sonor-setup codemod --check --json # an existing 2.x–7.x site → migrate (--write) if exit 1",
31
31
  "next build",
32
32
  "npx sonor-setup verify --json # exit 0 === done"
33
33
  ],
@@ -54,7 +54,7 @@
54
54
  "name": "codemod",
55
55
  "json": true,
56
56
  "interactive": false,
57
- "purpose": "Deterministic migration of a 2.x-6.x site to the current site-kit (uptrade-to-sonor, provider-to-layout, analytics-sibling, site-kit-7, next-16-proxy). Dry-run by default; --write applies; --check gates (exit 1 if pending)."
57
+ "purpose": "Deterministic migration of a 2.x-7.x site to the current site-kit (uptrade-to-sonor, provider-to-layout, analytics-sibling, site-kit-7, site-kit-8, next-16-proxy). site-kit-8 moves commerce imports to @sonordev/commerce-kit and adds the dependency. Dry-run by default; --write applies; --check gates (exit 1 if pending)."
58
58
  },
59
59
  {
60
60
  "name": "manifest",
@@ -135,18 +135,6 @@
135
135
  "purpose": "Page views, scroll depth, web vitals, heatmap clicks.",
136
136
  "caution": "SiteKitLayout already mounts this as a deferred, childless sibling (site-kit >=3.0.2); configure it with analytics={{ ... }} rather than mounting it yourself. Never wrap {children} in AnalyticsProvider: it puts analytics in the hydration path, and lazy-loaded with next/dynamic({ ssr: false }) it de-opts the route to client rendering (SSR bailout). Track custom events with the standalone trackEvent / trackConversion (no provider needed); useAnalytics() throws outside a provider."
137
137
  },
138
- {
139
- "name": "engage",
140
- "import": "@sonordev/site-kit/engage",
141
- "side": "client",
142
- "purpose": "Deprecated alias, kept through 7.x: Engage was retired in Sonor. Re-exports ./chat (ChatWidget, chat types) and ./website/popups under the old names; EngageWidget draws SiteChat and SitePopups.",
143
- "caution": "Import ./chat or ./website/popups instead, or let SiteKitLayout mount both (its chat and popups props). DesignRenderer (Engage Studio) is gone; popups render from blocks.",
144
- "stability": "deprecated",
145
- "movedTo": [
146
- "@sonordev/site-kit/chat",
147
- "@sonordev/site-kit/website/popups"
148
- ]
149
- },
150
138
  {
151
139
  "name": "signal",
152
140
  "import": "@sonordev/site-kit/signal",
@@ -188,17 +176,6 @@
188
176
  "side": "server",
189
177
  "purpose": "RSC-safe article UI: Article, ArticleList, PublicationLayout, PublicationSidebar, RelatedPosts, ClusterLandingPage, ClusterNavigation, and page helpers. Pass a shared routing object (basePath defaults to /articles) so a site keeps its own publication path. Article art, complete generated cards and themed table scrolling are handled by default."
190
178
  },
191
- {
192
- "name": "commerce",
193
- "import": "@sonordev/site-kit/commerce",
194
- "side": "mixed",
195
- "purpose": "Products, services, events, checkout."
196
- },
197
- {
198
- "name": "commerce/server",
199
- "import": "@sonordev/site-kit/commerce/server",
200
- "side": "unknown"
201
- },
202
179
  {
203
180
  "name": "sync",
204
181
  "import": "@sonordev/site-kit/sync",
@@ -420,17 +397,6 @@
420
397
  "import": "@sonordev/site-kit/website/slots/contract",
421
398
  "side": "unknown"
422
399
  },
423
- {
424
- "name": "website/cms",
425
- "import": "@sonordev/site-kit/website/cms",
426
- "side": "mixed",
427
- "purpose": "Deprecated in 7.1, removed in 8.0: the retired Sanity CMS. Use slots (managed copy) instead."
428
- },
429
- {
430
- "name": "website/cms/server",
431
- "import": "@sonordev/site-kit/website/cms/server",
432
- "side": "unknown"
433
- },
434
400
  {
435
401
  "name": "website/landing",
436
402
  "import": "@sonordev/site-kit/website/landing",
@@ -613,25 +579,6 @@
613
579
  "side": "server",
614
580
  "purpose": "Next.js config helper (image formats, etc.)."
615
581
  },
616
- {
617
- "name": "cms",
618
- "import": "@sonordev/site-kit/cms",
619
- "side": "mixed",
620
- "purpose": "Deprecated in 7.1, removed in 8.0: the retired Sanity CMS. Use slots (managed copy) instead.",
621
- "stability": "deprecated",
622
- "movedTo": [
623
- "@sonordev/site-kit/website/cms"
624
- ]
625
- },
626
- {
627
- "name": "cms/server",
628
- "import": "@sonordev/site-kit/cms/server",
629
- "side": "unknown",
630
- "stability": "deprecated",
631
- "movedTo": [
632
- "@sonordev/site-kit/website/cms/server"
633
- ]
634
- },
635
582
  {
636
583
  "name": "maps",
637
584
  "import": "@sonordev/site-kit/maps",
@@ -676,6 +623,13 @@
676
623
  "side": "client",
677
624
  "purpose": "useDeferredActivation + shared identity for deferred, non-blocking client work; VisualViewportGap keeps fixed bottom UI (the Echo launcher included) on screen when a phone's layout viewport is taller than the visible one."
678
625
  },
626
+ {
627
+ "name": "runtime",
628
+ "import": "@sonordev/site-kit/runtime",
629
+ "side": "mixed",
630
+ "purpose": "For packages that build on site-kit (such as @sonordev/commerce-kit): sonorFetch, the browser transport (site credential, retries, token refresh, auth breaker), getClientApiConfig/readPublishedApiConfig, the one reader of the API origin the layout publishes, and readAnalyticsIdentity, the visitor's analytics ids (read only).",
631
+ "caution": "Not stamped 'use client' and free of React, Next and server-only, so it works from server and client code alike. A site doesn't need it: forms, analytics and the other modules already use the same transport."
632
+ },
679
633
  {
680
634
  "name": "forms/static",
681
635
  "import": "@sonordev/site-kit/forms/static",
@@ -691,6 +645,100 @@
691
645
  ]
692
646
  }
693
647
  ],
648
+ "relocated": [
649
+ {
650
+ "from": "@sonordev/site-kit/commerce",
651
+ "to": "@sonordev/commerce-kit/commerce",
652
+ "package": "@sonordev/commerce-kit",
653
+ "range": "^1.0.0",
654
+ "since": "8.0.0"
655
+ },
656
+ {
657
+ "from": "@sonordev/site-kit/commerce/server",
658
+ "to": "@sonordev/commerce-kit/commerce/server",
659
+ "package": "@sonordev/commerce-kit",
660
+ "range": "^1.0.0",
661
+ "since": "8.0.0"
662
+ },
663
+ {
664
+ "from": "@sonordev/site-kit/memberships",
665
+ "to": "@sonordev/commerce-kit/memberships",
666
+ "package": "@sonordev/commerce-kit",
667
+ "range": "^1.0.0",
668
+ "since": "8.0.0"
669
+ },
670
+ {
671
+ "from": "@sonordev/site-kit/memberships/server",
672
+ "to": "@sonordev/commerce-kit/memberships/server",
673
+ "package": "@sonordev/commerce-kit",
674
+ "range": "^1.0.0",
675
+ "since": "8.0.0"
676
+ }
677
+ ],
678
+ "relocatedTypes": [
679
+ {
680
+ "from": "@sonordev/site-kit",
681
+ "types": [
682
+ "CommerceOffering",
683
+ "CommerceCategory",
684
+ "CommerceVariant",
685
+ "CommerceSchedule",
686
+ "OfferingType",
687
+ "Cart",
688
+ "CartItem",
689
+ "EventCheckoutProps",
690
+ "CheckoutLineItem"
691
+ ],
692
+ "to": "@sonordev/commerce-kit",
693
+ "range": "^1.0.0",
694
+ "since": "8.0.0"
695
+ }
696
+ ],
697
+ "removed": [
698
+ {
699
+ "import": "@sonordev/site-kit/engage",
700
+ "since": "8.0.0",
701
+ "why": "Retired in Sonor. Use @sonordev/site-kit/chat and @sonordev/site-kit/website/popups instead (the site-kit-7 codemod moves the names that have a home)."
702
+ },
703
+ {
704
+ "import": "@sonordev/site-kit/cms",
705
+ "since": "8.0.0",
706
+ "why": "The Sanity CMS is retired in Sonor and no longer serves pages. Site copy is managed copy: ManagedSlot, ManagedRichText, ManagedLink and ManagedList from @sonordev/site-kit/website/slots, edited in Sonor under Website → Content."
707
+ },
708
+ {
709
+ "import": "@sonordev/site-kit/cms/server",
710
+ "since": "8.0.0",
711
+ "why": "The Sanity CMS is retired in Sonor and no longer serves pages. Site copy is managed copy: ManagedSlot, ManagedRichText, ManagedLink and ManagedList from @sonordev/site-kit/website/slots, edited in Sonor under Website → Content."
712
+ },
713
+ {
714
+ "import": "@sonordev/site-kit/website/cms",
715
+ "since": "8.0.0",
716
+ "why": "The Sanity CMS is retired in Sonor and no longer serves pages. Site copy is managed copy: ManagedSlot, ManagedRichText, ManagedLink and ManagedList from @sonordev/site-kit/website/slots, edited in Sonor under Website → Content."
717
+ },
718
+ {
719
+ "import": "@sonordev/site-kit/website/cms/server",
720
+ "since": "8.0.0",
721
+ "why": "The Sanity CMS is retired in Sonor and no longer serves pages. Site copy is managed copy: ManagedSlot, ManagedRichText, ManagedLink and ManagedList from @sonordev/site-kit/website/slots, edited in Sonor under Website → Content."
722
+ },
723
+ {
724
+ "import": "@sonordev/site-kit/seo",
725
+ "export": "ManagedContent",
726
+ "since": "8.0.0",
727
+ "why": "Content blocks are retired in Sonor. Use ManagedRichText from @sonordev/site-kit/website/slots."
728
+ },
729
+ {
730
+ "import": "@sonordev/site-kit/seo",
731
+ "export": "getManagedContentData",
732
+ "since": "8.0.0",
733
+ "why": "Content blocks are retired in Sonor. Use ManagedRichText from @sonordev/site-kit/website/slots."
734
+ },
735
+ {
736
+ "import": "@sonordev/site-kit/seo",
737
+ "export": "getContentBlock",
738
+ "since": "8.0.0",
739
+ "why": "Content blocks are retired in Sonor. Use ManagedRichText from @sonordev/site-kit/website/slots."
740
+ }
741
+ ],
694
742
  "blessedPatterns": [
695
743
  {
696
744
  "id": "layout.sitekit",
@@ -762,6 +810,13 @@
762
810
  "cause": "The above-the-fold hero is opacity:0 + JS entrance-animated, so Chrome records LCP at the tween's end (or never).",
763
811
  "fix": "Render hero/first-paint content fully static; gate reveal animations to below-the-fold only. <Reveal> from @sonordev/site-kit/motion does this by construction (above-the-fold elements are never touched).",
764
812
  "check": null
813
+ },
814
+ {
815
+ "id": "commerce.moved",
816
+ "symptom": "Build can't resolve a site-kit commerce path: \"Can't resolve '@sonordev/site-kit/commerce'\" (Turbopack) or \"Package subpath './commerce' is not defined by \\\"exports\\\"\" (Node).",
817
+ "cause": "The site is on site-kit 8, where commerce moved to @sonordev/commerce-kit, which also carries the new memberships module. Nothing is left at the old paths.",
818
+ "fix": "Install @sonordev/commerce-kit, then run `npx sonor-setup codemod --only site-kit-8 --write` (it rewrites the imports, adds the dependency and raises site-kit to ^8), then build. A site that enables the MCP offerings tool also passes the reader: offerings: { path, read: getOfferingsResult } with getOfferingsResult from @sonordev/commerce-kit/commerce/server. The old paths and the new ones are listed under `relocated` in this manifest.",
819
+ "check": null
765
820
  }
766
821
  ]
767
822
  }
@@ -0,0 +1,13 @@
1
+ export { AnalyticsProvider, useAnalytics, useAnalyticsOptional, useTrackEvent } from './chunk-J65N34YM.js';
2
+ import './chunk-LCDVPAMR.js';
3
+ import './chunk-ZKADJNR2.js';
4
+ import './chunk-L2V5PUFN.js';
5
+ import './chunk-5TM3WPCI.js';
6
+ import './chunk-GJWI74ZZ.js';
7
+ import './chunk-CAH4Y4PY.js';
8
+ import './chunk-EKBEOXTH.js';
9
+ import './chunk-3G7YABRA.js';
10
+ import './chunk-56VDS2RP.js';
11
+ import './chunk-ZLFGXKLG.js';
12
+ import './chunk-5S2XDG5O.js';
13
+ import './chunk-PKBMQBKP.js';