@buildbase/sdk 0.0.70 → 0.0.73

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 (69) hide show
  1. package/AGENTS.md +5 -2
  2. package/CHANGELOG.md +114 -0
  3. package/README.md +141 -4
  4. package/dist/cli.mjs +2 -0
  5. package/dist/css/styles.css +1 -1
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.d.ts +589 -14
  8. package/dist/index.mjs +1 -1
  9. package/dist/mcp/index.cjs +1 -1
  10. package/dist/mcp/index.d.ts +102 -0
  11. package/dist/mcp/index.mjs +1 -1
  12. package/dist/react/chunks/SettingsDialog-CvBSuMf-.mjs +2 -0
  13. package/dist/react/chunks/SettingsDialog-DdOUkwIi.cjs +2 -0
  14. package/dist/react/chunks/SubscriptionDialog-CdZzF5eK.cjs +2 -0
  15. package/dist/react/chunks/SubscriptionDialog-D8_frxHc.mjs +2 -0
  16. package/dist/react/chunks/ar-CRVhjpVE.cjs +2 -0
  17. package/dist/react/chunks/ar-DFPDdu2U.mjs +2 -0
  18. package/dist/react/chunks/de-BGhzn711.cjs +2 -0
  19. package/dist/react/chunks/de-Bqi8scew.mjs +2 -0
  20. package/dist/react/chunks/es-D_Eqhob3.mjs +2 -0
  21. package/dist/react/chunks/es-DyrMaeUp.cjs +2 -0
  22. package/dist/react/chunks/fr-C0SkloRr.cjs +2 -0
  23. package/dist/react/chunks/fr-DkZpFQ1Q.mjs +2 -0
  24. package/dist/react/chunks/hi-B9TK87T8.cjs +2 -0
  25. package/dist/react/chunks/hi-DrTcPkiY.mjs +2 -0
  26. package/dist/react/chunks/ja-Dgahn--0.mjs +2 -0
  27. package/dist/react/chunks/ja-LjzlAhAT.cjs +2 -0
  28. package/dist/react/chunks/react-BSHCN-ZU.mjs +2 -0
  29. package/dist/react/chunks/react-DQqr117G.cjs +2 -0
  30. package/dist/react/chunks/zh-BezRHDHs.mjs +2 -0
  31. package/dist/react/chunks/zh-CcodKi4U.cjs +2 -0
  32. package/dist/react/index.cjs +1 -1
  33. package/dist/react/index.d.ts +826 -25
  34. package/dist/react/index.mjs +1 -1
  35. package/dist/server/browser.cjs +1 -0
  36. package/dist/server/browser.mjs +1 -0
  37. package/dist/server/index.cjs +1 -0
  38. package/dist/server/index.d.ts +556 -0
  39. package/dist/server/index.mjs +1 -0
  40. package/dist/server/next/index.cjs +1 -0
  41. package/dist/server/next/index.d.ts +156 -0
  42. package/dist/server/next/index.mjs +1 -0
  43. package/dist/tracking/index.cjs +1 -1
  44. package/dist/tracking/index.d.ts +205 -8
  45. package/dist/tracking/index.mjs +1 -1
  46. package/docs/ERROR_CODES.md +24 -0
  47. package/docs/SERVER-CONTENT.md +297 -0
  48. package/docs/UI-CONFIG.md +1 -0
  49. package/package.json +66 -5
  50. package/dist/react/chunks/SettingsDialog-VKPguQBs.mjs +0 -2
  51. package/dist/react/chunks/SettingsDialog-_kfJ6j25.cjs +0 -2
  52. package/dist/react/chunks/SubscriptionDialog-C_1ipsC2.cjs +0 -2
  53. package/dist/react/chunks/SubscriptionDialog-Cbk3EGBr.mjs +0 -2
  54. package/dist/react/chunks/ar-CHTRXlXt.mjs +0 -2
  55. package/dist/react/chunks/ar-DPJVNHJV.cjs +0 -2
  56. package/dist/react/chunks/de-CdPeKWZ2.mjs +0 -2
  57. package/dist/react/chunks/de-DPd09yf-.cjs +0 -2
  58. package/dist/react/chunks/es-BWGnjJKJ.mjs +0 -2
  59. package/dist/react/chunks/es-WdOYGt6G.cjs +0 -2
  60. package/dist/react/chunks/fr-Big5DFPB.mjs +0 -2
  61. package/dist/react/chunks/fr-LIbCvYeh.cjs +0 -2
  62. package/dist/react/chunks/hi-BoCY3pFe.cjs +0 -2
  63. package/dist/react/chunks/hi-jArNRknR.mjs +0 -2
  64. package/dist/react/chunks/ja-Cwdz0hCu.mjs +0 -2
  65. package/dist/react/chunks/ja-E0jqCiVq.cjs +0 -2
  66. package/dist/react/chunks/react-B0MFoaXI.mjs +0 -2
  67. package/dist/react/chunks/react-DSRfaDnZ.cjs +0 -2
  68. package/dist/react/chunks/zh-glRKcdia.mjs +0 -2
  69. package/dist/react/chunks/zh-tU-AqFYI.cjs +0 -2
@@ -0,0 +1,297 @@
1
+ # Content from your server
2
+
3
+ Blogs, docs, FAQs, testimonials, rich content and collection data are read
4
+ with an **org API token**. That token is your organization's key, so these
5
+ reads happen on your server or at build time, never in a browser.
6
+
7
+ `@buildbase/sdk/server` does the reading, caches it, and keeps the cache
8
+ honest when content changes. It works on any JavaScript server runtime, and
9
+ the HTTP rules underneath work from any language.
10
+
11
+ - [Pick a pattern](#pick-a-pattern)
12
+ - [Server client](#server-client)
13
+ - [Caching](#caching)
14
+ - [Content webhooks](#content-webhooks)
15
+ - [Build-time pull](#build-time-pull)
16
+ - [Next.js](#nextjs)
17
+ - [Other languages](#other-languages)
18
+ - [Reference](#reference)
19
+
20
+ ## Pick a pattern
21
+
22
+ | Your app | Use |
23
+ | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
24
+ | Has a server (Express, Fastify, NestJS, Hono, Remix, Astro SSR, Next) | [Server client](#server-client) with the [webhook](#content-webhooks) |
25
+ | Static site, single-page app, or no backend | [Build-time pull](#build-time-pull), rebuilt by a deploy hook when content changes |
26
+ | Not JavaScript (Python, Go, PHP, Ruby, Java) | [The HTTP API directly](#other-languages), with `If-None-Match` and the same webhook |
27
+
28
+ Whichever you pick, a page render should not call BuildBase. Fetch once, cache,
29
+ and let a webhook tell you when to fetch again. Reads that ignore caching
30
+ count against your plan's content-read allowance.
31
+
32
+ ## Server client
33
+
34
+ ```ts
35
+ import { createServerClient } from '@buildbase/sdk/server';
36
+
37
+ export const content = createServerClient({
38
+ serverUrl: 'https://api.console.buildbase.app',
39
+ apiToken: process.env.BUILDBASE_API_TOKEN!, // <orgId>:<secret>
40
+ });
41
+
42
+ const posts = await content.blogs.list({ limit: 20, sort: { publishedAt: -1 } });
43
+ const post = await content.blogs.byPath('guides/getting-started');
44
+ const refund = await content.richContent.get('refund-policy');
45
+ const questions = await content.faqs.questions('help-center');
46
+ const quotes = await content.testimonials.list();
47
+ const releases = await content.collections.data<{ title: string; version: string }>(
48
+ 'release-notes'
49
+ );
50
+ ```
51
+
52
+ Create the token in the console under **Settings, API tokens**. Give it the
53
+ read-only **content-reader** role: a token that can render a blog should not
54
+ be able to change your billing.
55
+
56
+ The client refuses to run in a browser. Bundlers building for the browser
57
+ resolve `@buildbase/sdk/server` to a module that throws at load, so a stray
58
+ import fails the build loudly instead of shipping your token.
59
+
60
+ Runtimes: Node 18+, Bun, Deno, Cloudflare Workers, Vercel and Netlify edge.
61
+ It uses only the standard `fetch`, `Request` and `Response`.
62
+
63
+ ### Express, Fastify, NestJS
64
+
65
+ ```ts
66
+ import express from 'express';
67
+ import { createContentWebhookHandler, toNodeHandler } from '@buildbase/sdk/server';
68
+ import { content } from './content';
69
+
70
+ const app = express();
71
+
72
+ app.get('/blog/:slug', async (req, res) => {
73
+ const post = await content.blogs.byPath(req.params.slug);
74
+ if (!post) return res.status(404).send('Not found');
75
+ res.render('post', { post });
76
+ });
77
+
78
+ // A raw body: the signature covers the exact bytes BuildBase sent.
79
+ app.post(
80
+ '/webhooks/buildbase',
81
+ express.raw({ type: 'application/json' }),
82
+ toNodeHandler(
83
+ createContentWebhookHandler({
84
+ secret: process.env.BUILDBASE_WEBHOOK_SECRET!,
85
+ cache: content.cache,
86
+ })
87
+ )
88
+ );
89
+ ```
90
+
91
+ Fastify and NestJS take the same `toNodeHandler(...)`; give the route a raw
92
+ body (a content-type parser that keeps the payload as a string or Buffer).
93
+
94
+ ### Hono, Cloudflare Workers, Deno, Bun
95
+
96
+ ```ts
97
+ import { Hono } from 'hono';
98
+ import { createServerClient, handleContentWebhook, kvCache } from '@buildbase/sdk/server';
99
+
100
+ type Env = { BUILDBASE_API_TOKEN: string; BUILDBASE_WEBHOOK_SECRET: string; CONTENT: KVNamespace };
101
+
102
+ const app = new Hono<{ Bindings: Env }>();
103
+ const client = (env: Env) =>
104
+ createServerClient({
105
+ serverUrl: 'https://api.console.buildbase.app',
106
+ apiToken: env.BUILDBASE_API_TOKEN,
107
+ cache: kvCache(env.CONTENT), // shared across isolates
108
+ });
109
+
110
+ app.get('/faq', async c => c.json(await client(c.env).faqs.questions('help-center')));
111
+
112
+ app.post('/webhooks/buildbase', c =>
113
+ handleContentWebhook(c.req.raw, {
114
+ secret: c.env.BUILDBASE_WEBHOOK_SECRET,
115
+ cache: client(c.env).cache,
116
+ })
117
+ );
118
+
119
+ export default app;
120
+ ```
121
+
122
+ ## Caching
123
+
124
+ Every read is cached. While an entry is fresh, a read costs nothing. Once it
125
+ is stale, the client asks BuildBase with `If-None-Match`; if nothing changed
126
+ the answer is an empty `304`, served from BuildBase's own cache without
127
+ touching its database.
128
+
129
+ | Option | Default | Meaning |
130
+ | ------------------- | --------------- | ----------------------------------------------------------------------------------------- |
131
+ | `cache` | `memoryCache()` | Where entries live. `false` turns caching off. |
132
+ | `defaultTtlSeconds` | `60` | Freshness when the response carries no `Cache-Control: max-age`. |
133
+ | `retainSeconds` | `86400` | How long a stale entry is kept, for revalidation and the error fallback. |
134
+ | `staleOnError` | `true` | Serve the last good copy if BuildBase errors or is unreachable. 401 and 403 always throw. |
135
+ | `timeoutMs` | `10000` | Per request. |
136
+
137
+ Stores:
138
+
139
+ - `memoryCache({ maxEntries })`: per process. Fine for one server.
140
+ - `redisCache(client, { prefix })`: shared. ioredis and node-redis v4+ both work.
141
+ - `kvCache(binding, { prefix })`: Cloudflare Workers KV, or Upstash Redis REST.
142
+ - Your own: implement `CacheStore` (`get`, `set`, `delete`, `deleteByTag`).
143
+
144
+ Identical reads that arrive at the same time share one request.
145
+
146
+ BuildBase answers content reads with
147
+ `Cache-Control: private, max-age=60, stale-while-revalidate=300`. The client
148
+ honours both numbers: an entry is fresh for 60 seconds, and for the five
149
+ minutes after that a read gets the cached copy at once while one background
150
+ request revalidates it. Only past both does a read wait for BuildBase.
151
+ `private` does not stop the client caching; it tells shared proxies and CDNs
152
+ not to store a response that was fetched with your token, and this cache lives
153
+ on your own server.
154
+
155
+ ### Tags
156
+
157
+ Each cached read carries tags, and `content.revalidate(tag)` drops everything
158
+ under one. The same strings appear in content webhooks:
159
+
160
+ | Tag | Covers |
161
+ | ----------------------------- | ----------------------------------------- |
162
+ | `buildbase:blog` | every blog list |
163
+ | `buildbase:blog:<slug>` | one post, by slug (same for every module) |
164
+ | `buildbase:blog:id:<id>` | one post, by id |
165
+ | `buildbase:collection:<slug>` | every record of one collection |
166
+ | `buildbase:all` | everything this client cached |
167
+
168
+ Modules: `blog`, `doc`, `faq`, `faq_collection`, `testimonial`,
169
+ `rich_content`, `collection`. `contentTags.*` builds them, and
170
+ `getContentTags(result)` tells you which tags a result was stored under.
171
+
172
+ ## Content webhooks
173
+
174
+ In the console, under **Settings, Webhooks**, add an endpoint pointing at your
175
+ route and subscribe it to the content events (or to everything; the handler
176
+ ignores what it does not need):
177
+
178
+ `blog.published`, `blog.updated`, `blog.unpublished`, `blog.deleted`, the same
179
+ four for `doc`, `faq.updated`, `faq_collection.updated`,
180
+ `testimonial.updated`, `testimonial.deleted`, `rich_content.updated`,
181
+ `rich_content.deleted`, `collection.version_published`,
182
+ `collection.record_created`, `collection.record_updated`,
183
+ `collection.record_deleted`.
184
+
185
+ `handleContentWebhook(request, { secret, cache })` verifies the signature
186
+ (HMAC-SHA256 over `<timestamp>.<body>`, five-minute window), drops the tags the
187
+ event names, and answers `200`. A bad signature gets `401`. Pass `revalidate`
188
+ instead of, or as well as, `cache` to invalidate a framework's own cache, and
189
+ `onEvent` to trigger anything else, such as a static site rebuild.
190
+
191
+ ## Build-time pull
192
+
193
+ For sites with no server of their own: pull the content once, in CI, and ship
194
+ it as a JSON file. The token stays in CI.
195
+
196
+ ```bash
197
+ BUILDBASE_SERVER_URL=https://api.console.buildbase.app \
198
+ BUILDBASE_API_TOKEN=$BUILDBASE_API_TOKEN \
199
+ npx buildbase content pull --out src/content/buildbase.json
200
+ ```
201
+
202
+ | Flag | Default |
203
+ | ----------------------- | ------------------------------------------------------ |
204
+ | `--out <file>` | required |
205
+ | `--modules <list>` | `blogs,docs,faqs,testimonials,richContent,collections` |
206
+ | `--collections <slugs>` | every live collection |
207
+ | `--page-size <n>` | `100` |
208
+ | `--server-url <url>` | `BUILDBASE_SERVER_URL` |
209
+
210
+ The file is `{ generatedAt, blogs, docs, faqs, testimonials, richContent, collections }`,
211
+ with published content only. `pullContent(client, options)` does the same from
212
+ your own build script.
213
+
214
+ To rebuild when content changes, point a content webhook at a small function
215
+ that calls your host's deploy hook, or use the console's deploy hooks
216
+ (**Settings, Deployments**).
217
+
218
+ ## Next.js
219
+
220
+ Next.js has its own data cache, keyed by tags. `@buildbase/sdk/server/next`
221
+ hands caching to it:
222
+
223
+ ```ts
224
+ // lib/content.ts
225
+ import { createServerClient } from '@buildbase/sdk/server';
226
+ import { withNextCache } from '@buildbase/sdk/server/next';
227
+
228
+ export const content = createServerClient({
229
+ serverUrl: process.env.BUILDBASE_SERVER_URL!,
230
+ apiToken: process.env.BUILDBASE_API_TOKEN!,
231
+ ...withNextCache({ revalidate: 300 }),
232
+ });
233
+ ```
234
+
235
+ ```ts
236
+ // app/api/webhooks/buildbase/route.ts
237
+ import { createNextWebhookHandler } from '@buildbase/sdk/server/next';
238
+
239
+ export const POST = createNextWebhookHandler({ secret: process.env.BUILDBASE_WEBHOOK_SECRET! });
240
+ ```
241
+
242
+ Every read goes out with `{ next: { tags, revalidate } }`, and the webhook calls
243
+ `revalidateTag` for what changed. `next` is an optional peer dependency; apps
244
+ on other frameworks never load it.
245
+
246
+ ## Other languages
247
+
248
+ The client is a convenience; the rules are HTTP.
249
+
250
+ - Send the token as `Authorization: Bearer <orgId>:<secret>` from your server.
251
+ - Reads answer with `ETag` and `Cache-Control`. Store the body and the ETag;
252
+ send `If-None-Match: <etag>` next time and a `304` means your copy is current.
253
+ - `filter` and `sort` are bracket-encoded: `?filter[published]=true&sort[publishedAt]=-1&$limit=20`.
254
+ - Verify webhooks: `hex(HMAC-SHA256(secret, timestamp + "." + rawBody))` must
255
+ equal the part after `sha256=` in `x-buildbase-signature`, and
256
+ `x-buildbase-timestamp` must be within five minutes. Then drop `data.tags`.
257
+
258
+ ```bash
259
+ curl -s -D - -H "Authorization: Bearer $BUILDBASE_API_TOKEN" \
260
+ "https://api.console.buildbase.app/api/rich-content/slug/refund-policy"
261
+ ```
262
+
263
+ ```python
264
+ import hmac, hashlib, time
265
+
266
+ def verify(secret: str, body: bytes, signature: str, timestamp: str) -> bool:
267
+ if abs(time.time() - int(timestamp)) > 300:
268
+ return False
269
+ expected = hmac.new(secret.encode(), timestamp.encode() + b"." + body, hashlib.sha256).hexdigest()
270
+ return hmac.compare_digest("sha256=" + expected, signature)
271
+ ```
272
+
273
+ ## Reference
274
+
275
+ | Call | Endpoint | Returns |
276
+ | ---------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------ |
277
+ | `blogs.list({ page, limit, filter, sort, includeDrafts })` | `GET /api/blogs` | `Paginated<BlogPost>`, published only by default |
278
+ | `blogs.get(id)` | `GET /api/blogs/:id` | `BlogPost \| null` |
279
+ | `blogs.byPath(path, { draftPreview })` | `GET /api/blogs/path?path=` | `BlogPost \| null` |
280
+ | `blogs.tree({ folder })` | `GET /api/blogs/folders/tree` | folder tree |
281
+ | `blogs.tags()`, `blogs.authors()` | `GET /api/blogs/tags`, `/authors` | `Paginated<...>` |
282
+ | `docs.*` | the same under `/api/docs` | `DocPage` |
283
+ | `faqs.collections()` | `GET /api/faqs/collections` | `Paginated<FaqCollection>` |
284
+ | `faqs.collection(slugOrId)` | `GET /api/faqs/collections/slug/:slug` or `/:id` | `FaqCollection \| null` |
285
+ | `faqs.questions(slugOrId)` | `GET /api/faqs/collections/slug/:slug/faqs` or `/:id/faqs` | `Faq[]`, `[]` when the collection does not exist |
286
+ | `testimonials.list({ includeUnpublished })` | `GET /api/testimonials` | published only by default |
287
+ | `testimonials.get(id)` | `GET /api/testimonials/:id` | `Testimonial \| null` |
288
+ | `richContent.get(slug)`, `.list()` | `GET /api/rich-content/slug/:slug` | `RichContent \| null` |
289
+ | `collections.data(slug, { version })`, `.list()` | `GET /api/collections/data/:slug?latest=true`, or `?version=` | `CollectionRecord[]` |
290
+ | `revalidate(tag)`, `revalidateAll()` | | drops cached reads |
291
+
292
+ The slug routes for FAQ collections, `GET /api/testimonials/:id` and
293
+ collection data without a `version` need the BuildBase server release that
294
+ ships content delivery; an older server answers those with 404 or 400. The
295
+ rest of the table works on any server.
296
+
297
+ Errors are `BuildBaseContentError` with `status`, `url` and the response `body`.
package/docs/UI-CONFIG.md CHANGED
@@ -59,6 +59,7 @@ Fine-grained switches inside each settings screen. All default to `true`.
59
59
  | `settings.users.roleChange` | Per-member role selector |
60
60
  | `settings.users.remove` | Remove-member button |
61
61
  | `settings.users.seatPricing` | Seat usage card + extra-seat cost warnings |
62
+ | `settings.users.invitations` | Pending-invitations list (with Resend and Revoke) under the invite form |
62
63
  | `settings.subscription.changePlan` | Every plan-picker entry point (change plan, view plans, upgrade banners) |
63
64
  | `settings.subscription.cancel` | Cancel-subscription button (Resume stays available) |
64
65
  | `settings.subscription.managePayment` | Stripe billing-portal button |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buildbase/sdk",
3
- "version": "0.0.70",
3
+ "version": "0.0.73",
4
4
  "type": "module",
5
5
  "description": "A SDK for Buildbase",
6
6
  "main": "dist/index.cjs",
@@ -37,12 +37,57 @@
37
37
  "require": "./dist/mcp/index.cjs",
38
38
  "default": "./dist/mcp/index.cjs"
39
39
  },
40
+ "./server": {
41
+ "types": "./dist/server/index.d.ts",
42
+ "workerd": "./dist/server/index.mjs",
43
+ "worker": "./dist/server/index.mjs",
44
+ "edge-light": "./dist/server/index.mjs",
45
+ "deno": "./dist/server/index.mjs",
46
+ "bun": "./dist/server/index.mjs",
47
+ "react-server": {
48
+ "import": "./dist/server/index.mjs",
49
+ "require": "./dist/server/index.cjs"
50
+ },
51
+ "node": {
52
+ "import": "./dist/server/index.mjs",
53
+ "require": "./dist/server/index.cjs"
54
+ },
55
+ "browser": {
56
+ "import": "./dist/server/browser.mjs",
57
+ "require": "./dist/server/browser.cjs"
58
+ },
59
+ "import": "./dist/server/index.mjs",
60
+ "require": "./dist/server/index.cjs",
61
+ "default": "./dist/server/index.cjs"
62
+ },
63
+ "./server/next": {
64
+ "types": "./dist/server/next/index.d.ts",
65
+ "edge-light": "./dist/server/next/index.mjs",
66
+ "react-server": {
67
+ "import": "./dist/server/next/index.mjs",
68
+ "require": "./dist/server/next/index.cjs"
69
+ },
70
+ "node": {
71
+ "import": "./dist/server/next/index.mjs",
72
+ "require": "./dist/server/next/index.cjs"
73
+ },
74
+ "browser": {
75
+ "import": "./dist/server/browser.mjs",
76
+ "require": "./dist/server/browser.cjs"
77
+ },
78
+ "import": "./dist/server/next/index.mjs",
79
+ "require": "./dist/server/next/index.cjs",
80
+ "default": "./dist/server/next/index.cjs"
81
+ },
40
82
  "./css": {
41
83
  "types": "./dist/css/styles.d.ts",
42
84
  "default": "./dist/css/styles.css"
43
85
  },
44
86
  "./package.json": "./package.json"
45
87
  },
88
+ "bin": {
89
+ "buildbase": "dist/cli.mjs"
90
+ },
46
91
  "typesVersions": {
47
92
  "*": {
48
93
  "react": [
@@ -59,6 +104,12 @@
59
104
  ],
60
105
  "tracking": [
61
106
  "./dist/tracking/index.d.ts"
107
+ ],
108
+ "server": [
109
+ "./dist/server/index.d.ts"
110
+ ],
111
+ "server/next": [
112
+ "./dist/server/next/index.d.ts"
62
113
  ]
63
114
  }
64
115
  },
@@ -71,14 +122,17 @@
71
122
  "docs/ERROR_CODES.md",
72
123
  "docs/MCP-AND-AGENT-READINESS.md",
73
124
  "docs/THEMING.md",
74
- "docs/UI-CONFIG.md"
125
+ "docs/UI-CONFIG.md",
126
+ "docs/SERVER-CONTENT.md"
75
127
  ],
76
128
  "sideEffects": [
77
- "**/*.css"
129
+ "**/*.css",
130
+ "./dist/server/browser.mjs",
131
+ "./dist/server/browser.cjs"
78
132
  ],
79
133
  "scripts": {
80
134
  "build": "rollup -c && rollup -c rollup.dts.config.js && npm run postbuild",
81
- "postbuild": "rimraf dist/types dist/react/types dist/data/types dist/mcp/types dist/tracking/types dist/*.map dist/react/*.map dist/data/*.map dist/mcp/*.map dist/tracking/*.map && mkdir -p dist/css && [ -f dist/react/styles.css ] && mv dist/react/styles.css dist/css/styles.css || true && cp src/css.d.ts dist/css/styles.d.ts",
135
+ "postbuild": "rimraf dist/types dist/react/types dist/data/types dist/mcp/types dist/tracking/types dist/server/types dist/server/next/types dist/server/browser-types dist/cli-types dist/*.map dist/react/*.map dist/data/*.map dist/mcp/*.map dist/tracking/*.map dist/server/*.map dist/server/next/*.map && mkdir -p dist/css && [ -f dist/react/styles.css ] && mv dist/react/styles.css dist/css/styles.css || true && cp src/css.d.ts dist/css/styles.d.ts",
82
136
  "build:analyze": "rollup --config rollup.config.analyze.js",
83
137
  "dev": "rollup -c -w",
84
138
  "clean": "rimraf dist",
@@ -103,7 +157,13 @@
103
157
  },
104
158
  "peerDependencies": {
105
159
  "react": "^18.0.0 || ^19.0.0",
106
- "react-dom": "^18.0.0 || ^19.0.0"
160
+ "react-dom": "^18.0.0 || ^19.0.0",
161
+ "next": ">=13"
162
+ },
163
+ "peerDependenciesMeta": {
164
+ "next": {
165
+ "optional": true
166
+ }
107
167
  },
108
168
  "dependencies": {
109
169
  "@hookform/resolvers": "^5.0.1",
@@ -126,6 +186,7 @@
126
186
  "intl-messageformat": "^11.2.0",
127
187
  "lucide-react": ">=0.544.0 <1",
128
188
  "react-hook-form": "^7.60.0",
189
+ "socket.io-client": "^4.8.3",
129
190
  "tailwind-merge": "^3.3.1",
130
191
  "zod": "^4.3.6"
131
192
  },