@tomorrowos/sdk 0.9.69 → 0.9.71

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.
package/README.md CHANGED
@@ -2,427 +2,168 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@tomorrowos/sdk.svg)](https://www.npmjs.com/package/@tomorrowos/sdk)
4
4
  [![license](https://img.shields.io/npm/l/@tomorrowos/sdk.svg)](https://www.npmjs.com/package/@tomorrowos/sdk)
5
- [![protocol](https://img.shields.io/badge/wire%20protocol-1.0-blue.svg)](#protocol-version)
6
5
 
7
- Build and own your digital signage CMS.
6
+ **Server SDK for building and self-hosting digital signage CMS products with TomorrowOS players.**
8
7
 
9
- An open-source SDK and player runtime for digital signage. One server-side API drives commercial signage panels �?you write the CMS, we handle device sessions, pairing, and the wire protocol.
10
-
11
- Apache 2.0. Build a proprietary CMS on top of it and sell it as your own �?no royalty, no permission needed.
8
+ Apache 2.0. You own the CMS you build - no seat licences, no revenue share, no required TomorrowOS cloud. Screens talk to *your* server.
12
9
 
13
10
  ---
14
11
 
15
12
  ## Requirements
16
13
 
17
14
  | | |
18
- |---|---|
19
- | Node.js | **18** or newer (`engines.node` in this package) |
20
- | npm | 9 or newer (or a compatible client) |
15
+ | --- | --- |
16
+ | Node.js | **20** or newer |
17
+ | npm | 10 or newer (or a compatible client) |
21
18
  | OS | macOS, Linux, Windows (WSL2 recommended on Windows) |
22
- | Network | CMS host reachable from your screens �?a public HTTPS address in production |
23
-
24
- Screens connect to your CMS over the network. For real panels, deploy to a public host (Railway, Render, Fly, Vercel Fluid, Replit, your own server), or use a tunnel while developing locally.
19
+ | Network | CMS reachable from your screens (public HTTPS in production) |
25
20
 
26
- There is no required TomorrowOS cloud. Your screens talk to *your* server.
21
+ There is no required TomorrowOS-hosted backend. Deploy on Railway, Render, Fly.io, Replit, Vercel Fluid, or your own Node host.
27
22
 
28
23
  ---
29
24
 
30
- ## Choose your path
25
+ ## Install / scaffold
31
26
 
32
- Three ways to build with this SDK. Pick one and follow it through.
33
-
34
- | | You are | Start here |
35
- |---|---|---|
36
- | **1** | Building with an AI tool on **Replit** (recommended) or **Vercel / v0** | [Build with an AI tool](#1-build-with-an-ai-tool) |
37
- | **2** | Writing the CMS yourself | [Build it yourself](#2-build-it-yourself) |
38
- | **3** | Adding screen management to an existing SaaS or web app | [Add to an existing app](#3-add-to-an-existing-app) |
39
-
40
- All three end in the same place: a running CMS with a paired screen. From there, go to [Connect a screen](#connect-a-screen).
27
+ ```bash
28
+ npm install @tomorrowos/sdk@latest
41
29
 
42
- ---
30
+ npx @tomorrowos/sdk@latest init my-cms
31
+ cd my-cms
32
+ npm install
33
+ npm run dev
34
+ ```
43
35
 
44
- ## 1. Build with an AI tool
36
+ For Vercel / v0 Publish, use:
45
37
 
46
- Guided setup is supported for **Replit** and **Vercel / v0** only. **Replit is recommended** for the fastest path to a live WebSocket CMS.
38
+ ```bash
39
+ npx @tomorrowos/sdk@latest init my-cms --hosting v0
40
+ ```
47
41
 
48
- | Host | Recommended AI mode |
49
- |------|---------------------|
50
- | **Replit** | **Power** |
51
- | **Vercel / v0** | **v0 Max** |
42
+ This starts a local CMS server and Control Panel. It does **not** by itself install a player or pair a screen. To connect hardware: deploy the CMS to a reachable HTTPS address, install a supported TomorrowOS player, and pair with the six-character code shown on screen. Details: [`PLAYER_INSTALL.md`](./PLAYER_INSTALL.md).
52
43
 
53
- The SDK ships an elicitation protocol so the agent asks the right questions before it writes anything. Skipping it reliably produces a CMS that doesn't run.
44
+ ---
54
45
 
55
- ### Replit (recommended) �?use Power agent mode
46
+ ## Choose your path
56
47
 
57
- Paste into Replit **Power**:
48
+ | | You are | Start here |
49
+ | --- | --- | --- |
50
+ | **1** | Building with an AI tool (**Replit** recommended, or **Vercel / v0**) | [AI-assisted](#1-ai-assisted) |
51
+ | **2** | Writing the CMS yourself | [Build it yourself](#2-build-it-yourself) |
52
+ | **3** | Adding screens to an existing SaaS or web app | [Add to an existing app](#3-add-to-an-existing-app) |
58
53
 
59
- ```text
60
- Follow NPM package @tomorrowos/sdk REPLIT_SETUP.md and set up my TomorrowOS CMS.
61
- ```
54
+ All three end in the same place: a running CMS you host, then a paired TomorrowOS player.
62
55
 
63
- On Replit, Supabase must use the `SUPABASE_URL` secret. `DATABASE_URL` is reserved by Replit for its built-in PostgreSQL.
56
+ ### 1. AI-assisted
64
57
 
65
- Upgrading an existing Replit CMS instead:
58
+ Paste into the agent (Replit **Power**, or **v0 Max**):
66
59
 
67
60
  ```text
68
- Follow NPM package @tomorrowos/sdk REPLIT_UPGRADE.md to upgrade my CMS with the latest SDK.
61
+ Follow NPM package @tomorrowos/sdk REPLIT_SETUP.md and set up my TomorrowOS CMS.
69
62
  ```
70
63
 
71
- That protocol diffs and merges against the current templates. It must never run `init --force` or delete `data/` or `public/uploads/`.
72
-
73
- ### Vercel / v0 �?use v0 Max
74
-
75
- Paste into **v0 Max** (or Vercel Agent with Max capability):
76
-
77
64
  ```text
78
65
  Follow NPM package @tomorrowos/sdk VERCEL_SETUP.md and set up my TomorrowOS CMS.
79
66
  ```
80
67
 
81
- Agents must paste questions from [`VERCEL_QUESTIONS.md`](./VERCEL_QUESTIONS.md) verbatim.
82
-
83
- Upgrading an existing Vercel / v0 CMS instead:
84
-
85
- ```text
86
- Follow NPM package @tomorrowos/sdk VERCEL_UPGRADE.md to upgrade my CMS with the latest SDK.
87
- ```
88
-
89
- That protocol installs `@tomorrowos/sdk@latest`, diffs `cms-starter-v0` templates, and must never run `init --force` or wipe Env Vars / media data.
90
-
91
- <details>
92
- <summary><strong>Agent workflow (for the agent, not you)</strong></summary>
93
-
94
- Supported hosts: **Replit** and **Vercel / v0**. Prefer **Replit Power agent mode** and **v0 Max**.
68
+ Upgrades use `REPLIT_UPGRADE.md` / `VERCEL_UPGRADE.md`. Those protocols install `@tomorrowos/sdk@latest`, merge template changes, and must **not** run `init --force` or wipe `data/` / uploads / env vars on an existing project.
95
69
 
96
- 1. Follow the host setup doc for this request (`REPLIT_SETUP.md` / `REPLIT_UPGRADE.md`, or `VERCEL_SETUP.md` + `VERCEL_QUESTIONS.md` / `VERCEL_UPGRADE.md`).
97
- 2. On Vercel: paste Q1–Q3 **verbatim** from `VERCEL_QUESTIONS.md`; after database choice set `TOMORROWOS_STORE` and `DATABASE_SSL` yourself; after media choice set `TOMORROWOS_MEDIA` yourself.
98
- 3. Read `brand.schema.json` for the validated shape of `brand.json`.
99
- 4. Scaffold with the correct template (**always `@latest`**):
100
- - Replit / self-host style: `npx @tomorrowos/sdk@latest init .` (default `cms-starter`)
101
- - Vercel / v0: `npx @tomorrowos/sdk@latest init . --hosting v0 --force` (`cms-starter-v0`)
102
- 5. Apply the user’s answers �?brand and use case. Validate `brand.json`. On Vercel, apply the **NON-NEGOTIABLE VERCEL RUNTIME CONTRACT** from `VERCEL_SETUP.md`.
103
- 6. Point the user at `PLAYER_INSTALL.md` and the Control Panel **Download Players** UI once the CMS is running.
70
+ ### 2. Build it yourself
104
71
 
105
- Do not write WebSocket transport, pairing wire format, or platform-specific player bridge code. The SDK handles server-side device sessions and HTTP helpers. Customise the UI, the branding, and how you call the SDK.
72
+ Scaffold with `init`, then deploy to a host with a **persistent Node process** and long-lived WebSockets. Prefer Railway, Render, Fly.io, Replit, or Vercel Fluid (v0 template). Avoid classic short-lived serverless without WebSocket support.
106
73
 
107
- </details>
74
+ ### 3. Add to an existing app
108
75
 
109
- **Next:** [Connect a screen](#connect-a-screen).
76
+ Keep your auth, users, tenancy model, and UI. Import `@tomorrowos/sdk` for device sessions, pairing, playlist / policy delivery, and optional static CMS helpers. Map device IDs to your own tenant records - the SDK does not impose multi-tenancy.
110
77
 
111
78
  ---
112
79
 
113
- ## 2. Build it yourself
80
+ ## What this package handles
114
81
 
115
- ```bash
116
- npm install @tomorrowos/sdk@latest
117
- ```
118
-
119
- Scaffold, install, run:
120
-
121
- ```bash
122
- # Default template (good for Replit, Railway, Render, Fly.io, self-host)
123
- npx @tomorrowos/sdk@latest init my-cms
124
-
125
- # Vercel / v0 Publish (cms-panel + vercel.json + optional Next preview)
126
- npx @tomorrowos/sdk@latest init my-cms --hosting v0
82
+ - CMS server (`TomorrowOS.listen`) - HTTP helpers + WebSocket device channel
83
+ - Device pairing (`POST /pairing/verify`, `POST /pairing/unpair`)
84
+ - Playlist catalog and content policy push to players
85
+ - Media upload helpers (local, Cloudinary, Vercel Blob, Replit Object Storage)
86
+ - Stores: SQLite, Postgres / Supabase, or memory (demos only)
87
+ - Optional starter Control Panel and `GET /brand.json`
88
+ - CLI: `tomorrowos init`
89
+ - BrightSign zip rewrite: `GET /players/brightsign.zip`
127
90
 
128
- cd my-cms
129
- npm install
130
- npm run dev
131
- ```
132
-
133
- `init` creates `data/tomorrowos.db` with the TomorrowOS SQLite schema. The starter server uses it by default, so pairings, playlists, and device assignments survive restarts.
91
+ ## What it does not handle
134
92
 
135
- **Recommended deploy hosts** for this path (long-lived Node + WebSockets):
93
+ - Building or signing on-device **player** packages
94
+ - A hosted TomorrowOS SaaS you must subscribe to
95
+ - Your product UI, authentication, billing, or business workflows
96
+ - Guaranteeing every panel model / firmware without certification on real hardware
136
97
 
137
- | Host | Notes |
138
- |---|---|
139
- | **Railway** | Simple Node deploy; good default for self-built CMS |
140
- | **Render** | Web Service with persistent process |
141
- | **Fly.io** | Global edge VMs; hold WebSockets cleanly |
142
- | **Replit** | Fastest AI-assisted path �?see [Build with an AI tool](#1-build-with-an-ai-tool) |
143
- | **Vercel Fluid** | Use `--hosting v0` and follow [`VERCEL_SETUP.md`](./VERCEL_SETUP.md) |
98
+ Player install and pairing: `PLAYER_INSTALL.md`. Deep hosting and agent protocols ship as Markdown beside this README and in Mintlify.
144
99
 
145
- Avoid classic short-lived serverless without WebSocket support.
146
-
147
- You now have a CMS serving:
100
+ ---
148
101
 
149
- - pairing HTTP helpers (`POST /pairing/verify`, `POST /pairing/unpair`)
150
- - `GET /brand.json` for player branding
151
- - a WebSocket device channel
152
- - media upload helpers (`/media/upload`, and Cloudinary direct upload when configured)
153
- - `GET /players/brightsign.zip` �?BrightSign package with `config.js` `cmsEndpoint` set to this CMS origin
154
- - a minimal admin panel (static UI under `staticRoot`)
102
+ ## Supported platforms
155
103
 
156
- Deploy it to a public HTTPS address before pairing a production screen. While developing locally, a tunnel is the fastest way to get one.
104
+ | Platform | Launch status | Important limitation |
105
+ | --- | --- | --- |
106
+ | Samsung Tizen 6.5 and 7.0 | Supported | Certified models and firmware only |
107
+ | BrightSign Series 3-6 | Supported | Series 3 requires firmware **9.1.140+** |
108
+ | BrightSign Series 3 4K H.264 | Not supported | Use certified **1080p H.264** media |
109
+ | Android | Planned | Not available for production |
110
+ | LG webOS | Planned | Not available for production |
111
+ | Windows | Planned | Not available for production |
157
112
 
158
- **Next:** [Connect a screen](#connect-a-screen).
113
+ Treat a combination as production-ready only after you validate it on your panels.
159
114
 
160
115
  ---
161
116
 
162
- ## 3. Add to an existing app
163
-
164
- If you already have a SaaS or web app and want screen management as a feature inside it, you don't need the starter. Import the SDK into your existing server.
165
-
166
- ```bash
167
- npm install @tomorrowos/sdk
168
- ```
117
+ ## Minimal working server
169
118
 
170
119
  ```ts
120
+ import { readFileSync } from "fs";
171
121
  import { createTomorrowOSStore, TomorrowOS } from "@tomorrowos/sdk";
172
122
 
123
+ const brand = JSON.parse(readFileSync("./brand.json", "utf8"));
173
124
  const store = createTomorrowOSStore({
174
- // Prefer SUPABASE_URL on Replit; DATABASE_URL elsewhere / fallback
175
- databaseUrl: process.env.SUPABASE_URL || process.env.DATABASE_URL
125
+ databaseUrl: process.env.SUPABASE_URL || process.env.DATABASE_URL,
126
+ sqlitePath: "./data/tomorrowos.db"
176
127
  });
177
128
 
178
129
  const tomorrowos = new TomorrowOS({ brand, store });
179
130
 
180
- const server = tomorrowos.listen({
131
+ tomorrowos.listen({
181
132
  port: Number(process.env.PORT) || 3000,
182
133
  host: "0.0.0.0",
183
134
  staticRoot: "./public" // optional Control Panel + uploads
184
135
  });
185
136
  ```
186
137
 
187
- What you keep from your app: your auth, your users, your tenancy model, your UI. What the SDK adds: device sessions, the pairing handshake, playlist/policy delivery, and optional static CMS helpers.
138
+ Validate `brand.json` against `brand.schema.json`.
188
139
 
189
- Points to plan for:
140
+ After `listen()` is up, connect hardware in this order:
190
141
 
191
- - **Multi-tenancy.** Devices belong to whatever tenant model you already have. The SDK does not impose one �?map device IDs to your own tenant records.
192
- - **Auth.** Pairing is a device-side flow. Your admin routes stay behind your existing auth.
193
- - **Store.** Use `createTomorrowOSStore` / `TOMORROWOS_STORE` for SQLite, Postgres, or Supabase, or pass a custom `TomorrowOSStore`.
194
- - **WebSockets.** Your host must hold long-lived connections. Most serverless platforms terminate idle sockets �?check before you commit (Vercel needs Fluid compute).
142
+ 1. Deploy the CMS to a public HTTPS address (or a tunnel for lab tests).
143
+ 2. Install a verified player package - see `PLAYER_INSTALL.md`.
144
+ 3. Pair with the six-character code shown on the screen.
145
+ 4. Publish a playlist from the Control Panel.
195
146
 
196
- **Next:** [Connect a screen](#connect-a-screen).
147
+ Deeper topics - database migration, media backends, Vercel Fluid wiring, Replit secrets, troubleshooting - live in Mintlify and the setup Markdown files shipped with this package, not on this npm landing page.
197
148
 
198
149
  ---
199
150
 
200
- ## Architecture
201
-
202
- ```
203
- ┌─────────────────�? WebSocket ┌─────────────────�?
204
- �? Your CMS �?◄────────────────────────►│ TomorrowOS �?
205
- �? (your server) �? �? Player on �?
206
- �? �? �? screen �?
207
- �? imports �? �? �?
208
- �? @tomorrowos �? �? unified API �?
209
- �? /sdk �? �? across panels �?
210
- └─────────────────�? └─────────────────�?
211
- ```
151
+ ## Documentation and support
212
152
 
213
- You own the CMS: the UI, the branding, the business logic, the data. The SDK owns the device session, the pairing handshake, and the wire protocol.
153
+ | Resource | Source |
154
+ | --- | --- |
155
+ | Website | [https://tomorrowos.org](https://tomorrowos.org) |
156
+ | Product docs | [https://docs.tomorrowos.org](https://docs.tomorrowos.org) |
157
+ | Player install | `PLAYER_INSTALL.md` |
158
+ | Replit setup / upgrade | `REPLIT_SETUP.md` / `REPLIT_UPGRADE.md` |
159
+ | Vercel / v0 | `VERCEL_SETUP.md` / `VERCEL_QUESTIONS.md` / `VERCEL_UPGRADE.md` |
214
160
 
215
- You should not need to write WebSocket transport, pairing wire format, or platform-specific player bridge code. If you find yourself doing that, open an issue �?it means the SDK has a gap.
161
+ If this README disagrees with package behaviour, treat that as a bug and report it.
216
162
 
217
163
  ---
218
164
 
219
- ## Connect a screen
220
-
221
- Your CMS is running. This is what happens next, in order.
222
-
223
- 1. **Deploy the CMS to a public HTTPS address** (or tunnel for local tests). Screens must reach it from their network.
224
- 2. **Get a player package** for your platform (see below and [`PLAYER_INSTALL.md`](./PLAYER_INSTALL.md)).
225
- Note: `npx tomorrowos build --platform …` is still a **placeholder** in this package �?packaging lives in the player repos / prebuilt downloads, not in the CLI yet.
226
- 3. **Install the player on the panel.**
227
- 4. **Pair.** The player shows a 6-character code. Enter it in the Control Panel. The device appears in your device list.
228
- 5. **Publish content.** Assign playlists / push a content policy. The screen updates without reloading the app.
229
-
230
- ### Samsung Tizen
231
-
232
- Supported target: **Tizen 6.5+** commercial displays (see Control Panel captions and [`PLAYER_INSTALL.md`](./PLAYER_INSTALL.md)).
233
-
234
- **Fastest path for many setups �?URL Launcher / prebuilt package**
235
-
236
- - From a running Control Panel, use **Download Players �?Samsung**, or fetch the published Tizen package from TomorrowOS distribution (`https://tmr.sh/app/tizen/…`).
237
- - Or host / sideload a `.wgt` as described in [`PLAYER_INSTALL.md`](./PLAYER_INSTALL.md).
238
-
239
- On the panel, enter the CMS HTTPS URL (or the player package URL your install path requires). The player shows a pairing code.
240
-
241
- Signed packages need a Samsung distributor certificate for production distribution. Unsigned / URL Launcher paths are fine for testing when your environment allows them.
242
-
243
- ### BrightSign
244
-
245
- Supported target: **Series 5 / 6** (as labeled in the Control Panel). Older series may work but should be validated on your hardware before fleet rollout.
246
-
247
- **Recommended download path**
248
-
249
- 1. Open your live CMS Control Panel �?**Download Players �?BrightSign**.
250
- 2. That hits `GET /players/brightsign.zip` on *this* CMS.
251
- 3. The SDK fetches the mother zip and rewrites `config.js` so:
252
-
253
- ```js
254
- cmsEndpoint: "https://your-cms-host/"
255
- ```
256
-
257
- matches the CMS you downloaded from (for example `https://testcms2.replit.app/`).
258
-
259
- 4. Unzip, copy the **contents** to a microSD card (files at the card root, including `autorun.brs` and `config.js`).
260
- 5. Insert the card and power on. Pair with the on-screen code.
261
-
262
- Override the mother zip URL with `TOMORROWOS_BRIGHTSIGN_ZIP_URL` if you host your own package.
263
-
264
- ### Coming soon
265
-
266
- Android, LG webOS, and Windows are on the roadmap. They are not validated for production in this SDK release.
267
-
268
- If you are building for one of those platforms later: build your CMS against the same server API now. Server-side code does not need to change when a new player package lands �?only the installable player does.
269
-
270
- ---
271
-
272
- ## Platform support
273
-
274
- | Platform | Status | Install |
275
- |---|---|---|
276
- | Samsung Tizen 6.5+ | V1 supported | Control Panel download / `.wgt` / URL Launcher �?see `PLAYER_INSTALL.md` |
277
- | BrightSign Series 5, 6 | V1 supported | Control Panel `GET /players/brightsign.zip` �?microSD autorun |
278
- | BrightSign older series | Validate on hardware | Same autorun zip flow |
279
- | Android | Roadmap | �?|
280
- | LG webOS | Roadmap | �?|
281
- | Windows | Roadmap | �?|
282
-
283
- Treat a platform as production-ready only after you have validated it on your panels.
284
-
285
- ---
286
-
287
- ## Configuration
288
-
289
- ### Database
290
-
291
- SQLite by default (no configuration required for the starter). To switch:
292
-
293
- ```bash
294
- TOMORROWOS_STORE=supabase
295
- SUPABASE_URL=postgresql://...
296
- DATABASE_SSL=true
297
- # DATABASE_URL=... # optional fallback outside Replit
298
- ```
299
-
300
- Supported store drivers: `sqlite`, `postgres`, `supabase`, `memory`.
301
-
302
- Use `memory` for throwaway demos only �?nothing survives a restart.
303
-
304
- ### Migrating between stores
305
-
306
- ```bash
307
- npx tomorrowos migrate \
308
- --from sqlite \
309
- --from-sqlite ./data/tomorrowos.db \
310
- --to supabase \
311
- --to-database-url "$DATABASE_URL"
312
- ```
313
-
314
- Works in either direction across `sqlite`, `postgres`, and `supabase`. It moves database records only �?copy `public/uploads` or object-storage / Cloudinary media separately.
315
-
316
- ### Media
317
-
318
- - **Local disk:** small files may use `POST /media/upload`. Larger files use **chunked upload** (`/media/upload-init` �?`/media/upload-chunk` �?`/media/upload-complete`).
319
- - **Replit Object Storage:** set `TOMORROWOS_MEDIA=replit-object-storage` (auto-preferred on Replit when Cloudinary is unset). Uses `@replit/object-storage`; URLs stay `/uploads/...` and are served from the bucket after Republish. Same upload HTTP routes as local.
320
- - **Cloudinary:** set `CLOUDINARY_CLOUD_NAME`, `CLOUDINARY_API_KEY`, `CLOUDINARY_API_SECRET` (optional `CLOUDINARY_FOLDER`). The Control Panel uses **browser �?Cloudinary** direct upload (`/media/upload-sign` + `/media/register`) when Cloudinary is configured.
321
- - **Vercel Blob:** set `BLOB_READ_WRITE_TOKEN` and `TOMORROWOS_MEDIA=vercel-blob` (token alone also auto-enables Blob when Cloudinary is unset). SDK uploads via `@vercel/blob` `put()`; asset URLs are absolute `https://*.public.blob.vercel-storage.com/...`.
322
-
323
- Cloudinary account plans still enforce their own max file sizes (for example Free plan video caps).
324
-
325
- ### Branding
326
-
327
- Pass a brand object to the constructor (usually loaded from `brand.json`):
328
-
329
- ```ts
330
- const tomorrowos = new TomorrowOS({ brand, store });
331
- ```
332
-
333
- It is served at `GET /brand.json` on the same host as `listen`. Players fetch it for colours, logos, and display defaults.
334
-
335
- Validate against [`brand.schema.json`](./brand.schema.json). A complete example is in [`brand.example.json`](./brand.example.json).
336
-
337
- ### Content policy and scheduling
338
-
339
- ```
340
- POST /device/{deviceId}/content/set-policy
341
- ```
342
-
343
- ```json
344
- {
345
- "policy": {
346
- "playlists": [],
347
- "fallback": { "type": "brand" }
348
- }
349
- }
350
- ```
351
-
352
- Each playlist may include optional `schedule`, evaluated in **device local time**. The run window is **one continuous period**:
353
-
354
- **from** `startDate` + `start` **�?until** `endDate` + `end` (until is exclusive).
355
-
356
- | Field | Format | Notes |
357
- |---|---|---|
358
- | `startDate` / `endDate` | `YYYY-MM-DD` | Combined with `start` / `end`; omit bounds for open-ended |
359
- | `start` / `end` | `HH:mm` | Clock times on those dates |
360
-
361
- This is **not** a daily-repeat schedule inside a date range. Leave schedule empty for always-on. Example shape: [`templates/cms-starter/policy.example.json`](./templates/cms-starter/policy.example.json) (ignore legacy `daysOfWeek` if present).
362
-
363
- ---
364
-
365
- ## Troubleshooting
366
-
367
- **Screen won't pair.**
368
- The player must reach your CMS. Confirm a public HTTPS (or reachable tunnel) URL, DNS, firewall, and that the panel has network access. A CMS only on `localhost` will not pair from a real display.
369
-
370
- **Paired, but the screen is black (BrightSign).**
371
- Common causes: media the player cannot decode (codec / profile / unexpected tracks), or HTML video surface alpha / HTML widget timing in `autorun.brs`. Re-encode to a supported profile and confirm `config.js` points at the correct CMS. Check player logs on the device.
372
-
373
- **Paired, but the screen is black (other).**
374
- Fetch `GET /brand.json` from the panel’s network. A live WebSocket with a black screen usually means no playable policy item �?check published playlists, absolute media URLs, and fallback.
375
-
376
- **Media 404s on the screen but loads in your browser.**
377
- Policy URLs must be absolute and reachable from the screen. Relative paths or hosts only visible on your laptop will fail on the panel.
378
-
379
- **Upload fails with HTTP 413 on Replit (or similar hosts).**
380
- Use `@tomorrowos/sdk` Control Panel / templates: non-Cloudinary uploads over ~2MB go through **chunked** `/media/upload-chunk`. On Replit, set `TOMORROWOS_MEDIA=replit-object-storage` (or rely on auto-detect) so files land in App Storage. On Vercel Blob, set `TOMORROWOS_MEDIA=vercel-blob` + `BLOB_READ_WRITE_TOKEN` so proxy/chunked complete stores absolute Blob URLs. With Cloudinary configured, the panel uses browser direct upload instead.
381
-
382
- **BrightSign zip has empty `cmsEndpoint`.**
383
- You downloaded the mother zip from a static CDN instead of **this** CMS’s `/players/brightsign.zip`. Use Control Panel �?Download Players �?BrightSign on the deployed CMS.
384
-
385
- **WebSocket disconnects on a serverless host.**
386
- Most serverless platforms terminate idle connections. Vercel requires Fluid compute. Prefer a long-lived Node host (Railway, Render, Fly, Replit) if your platform cannot hold sockets.
387
-
388
- **Database changes don't persist.**
389
- You are probably on `TOMORROWOS_STORE=memory`. Switch to `sqlite` or Postgres/Supabase.
390
-
391
- ---
392
-
393
- ## Getting help
394
-
395
- - **Package docs:** the Markdown files listed below ship inside `@tomorrowos/sdk`
396
- - **npm:** [https://www.npmjs.com/package/@tomorrowos/sdk](https://www.npmjs.com/package/@tomorrowos/sdk)
397
-
398
- If something in this README doesn't match what the package actually does, treat that as a bug and report it �?documentation drift matters as much as a code defect.
399
-
400
- ---
401
-
402
- ## Documentation in this package
403
-
404
- | File | Purpose |
405
- |---|---|
406
- | [`PLAYER_INSTALL.md`](./PLAYER_INSTALL.md) | Player install and pairing notes |
407
- | [`brand.schema.json`](./brand.schema.json) | JSON Schema for `brand.json` |
408
- | [`brand.example.json`](./brand.example.json) | Complete example `brand.json` |
409
- | [`REPLIT_SETUP.md`](./REPLIT_SETUP.md) | Replit Agent guided setup |
410
- | [`REPLIT_UPGRADE.md`](./REPLIT_UPGRADE.md) | Upgrading an existing Replit CMS |
411
- | [`VERCEL_SETUP.md`](./VERCEL_SETUP.md) | Vercel / v0 guided setup |
412
- | [`VERCEL_QUESTIONS.md`](./VERCEL_QUESTIONS.md) | Verbatim Q1–Q3 text for Vercel agents |
413
- | [`VERCEL_UPGRADE.md`](./VERCEL_UPGRADE.md) | Upgrading an existing Vercel / v0 CMS |
414
- | [`templates/cms-starter/`](./templates/cms-starter/) | Minimal Node + TypeScript server seed |
415
- | [`templates/cms-starter-v0/`](./templates/cms-starter-v0/) | Vercel / v0 starter (Fluid + cms-panel) |
416
- | [`templates/style-tokens/`](./templates/style-tokens/) | CSS tokens and UI pattern notes |
417
-
418
- ---
419
-
420
- ## License
421
-
422
- Apache 2.0 (see `license` in `package.json`).
423
-
424
- You can use TomorrowOS commercially, modify it, and build closed-source products on top of it. You can ship a proprietary CMS built on this SDK and sell it under your own brand. You do not owe a fee, a licence, or a mention.
165
+ ## Licence and status
425
166
 
426
- ## Protocol version
167
+ **Apache 2.0.** Build commercial products on this SDK and keep your CMS proprietary - no fee, no revenue share, no requirement to open-source your application.
427
168
 
428
- Wire protocol **1.0** (see `protocolVersion` in [`brand.example.json`](./brand.example.json) and the TomorrowOS player/CMS contract).
169
+ Current release: **0.9.x** (pre-1.0). APIs may still change. Pin your version in production.