@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/PLAYER_INSTALL.md +181 -123
- package/README.md +87 -346
- package/REPLIT_SETUP.md +191 -191
- package/VERCEL_QUESTIONS.md +1 -1
- package/VERCEL_SETUP.md +4 -4
- package/dist/cli.js +9 -5
- package/dist/playlist-catalog.d.ts +0 -3
- package/dist/playlist-catalog.d.ts.map +1 -1
- package/dist/playlist-catalog.js +0 -1
- package/dist/tomorrowos.js +1 -1
- package/package.json +3 -3
- package/templates/cms-starter/.env.example +19 -0
- package/templates/cms-starter/package.json +3 -4
- package/templates/cms-starter/policy.example.json +1 -2
- package/templates/cms-starter/public/index.html +7 -3
- package/templates/cms-starter/public/methods.js +21 -11
- package/templates/cms-starter/public/panel.css +10 -0
- package/templates/cms-starter-v0/.env.example +19 -0
- package/templates/cms-starter-v0/cms-panel/index.html +7 -3
- package/templates/cms-starter-v0/cms-panel/methods.js +21 -11
- package/templates/cms-starter-v0/cms-panel/panel.css +10 -0
- package/templates/cms-starter-v0/package.json +3 -4
- package/templates/cms-starter-v0/policy.example.json +1 -2
package/README.md
CHANGED
|
@@ -2,427 +2,168 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@tomorrowos/sdk)
|
|
4
4
|
[](https://www.npmjs.com/package/@tomorrowos/sdk)
|
|
5
|
-
[](#protocol-version)
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
**Server SDK for building and self-hosting digital signage CMS products with TomorrowOS players.**
|
|
8
7
|
|
|
9
|
-
|
|
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 | **
|
|
20
|
-
| npm |
|
|
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
|
|
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
|
|
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
|
-
##
|
|
25
|
+
## Install / scaffold
|
|
31
26
|
|
|
32
|
-
|
|
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
|
-
|
|
36
|
+
For Vercel / v0 Publish, use:
|
|
45
37
|
|
|
46
|
-
|
|
38
|
+
```bash
|
|
39
|
+
npx @tomorrowos/sdk@latest init my-cms --hosting v0
|
|
40
|
+
```
|
|
47
41
|
|
|
48
|
-
|
|
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
|
-
|
|
44
|
+
---
|
|
54
45
|
|
|
55
|
-
|
|
46
|
+
## Choose your path
|
|
56
47
|
|
|
57
|
-
|
|
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
|
-
|
|
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
|
-
|
|
56
|
+
### 1. AI-assisted
|
|
64
57
|
|
|
65
|
-
|
|
58
|
+
Paste into the agent (Replit **Power**, or **v0 Max**):
|
|
66
59
|
|
|
67
60
|
```text
|
|
68
|
-
Follow NPM package @tomorrowos/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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
74
|
+
### 3. Add to an existing app
|
|
108
75
|
|
|
109
|
-
|
|
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
|
-
##
|
|
80
|
+
## What this package handles
|
|
114
81
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
146
|
-
|
|
147
|
-
You now have a CMS serving:
|
|
100
|
+
---
|
|
148
101
|
|
|
149
|
-
|
|
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
|
-
|
|
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
|
-
|
|
113
|
+
Treat a combination as production-ready only after you validate it on your panels.
|
|
159
114
|
|
|
160
115
|
---
|
|
161
116
|
|
|
162
|
-
##
|
|
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
|
-
|
|
175
|
-
|
|
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
|
-
|
|
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
|
-
|
|
138
|
+
Validate `brand.json` against `brand.schema.json`.
|
|
188
139
|
|
|
189
|
-
|
|
140
|
+
After `listen()` is up, connect hardware in this order:
|
|
190
141
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
161
|
+
If this README disagrees with package behaviour, treat that as a bug and report it.
|
|
216
162
|
|
|
217
163
|
---
|
|
218
164
|
|
|
219
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
169
|
+
Current release: **0.9.x** (pre-1.0). APIs may still change. Pin your version in production.
|