Runnable example integrations of @pagehub/sdk,
the embeddable white-label page builder. Each folder is a standalone, copy-pasteable
app that consumes the published SDK from npm — so what you see is exactly what
you'd get installing the package yourself.
| Demo | Stack | What it shows | Port |
|---|---|---|---|
vanilla-html/ |
Plain HTML, no build | PageHub.init() into a <div>. SDK from a CDN <script> tag — nothing to compile. |
4400 |
vite-react/ |
Vite + React + TS | import { PageHubEditor }, a custom defineComponent, editor ↔ viewer toggle. |
4401 |
nextjs/ |
Next.js App Router | Editor loaded client-only via dynamic({ ssr: false }); viewer route. |
4402 |
pnpm install
pnpm dev:vanilla # http://localhost:4400 — no framework
pnpm dev:vite # http://localhost:4401 — Vite + React
pnpm dev:next # http://localhost:4402 — Next.jsThe vanilla demo needs no install of the SDK — it loads from unpkg. The vite and nextjs demos install
@pagehub/sdk(plus its peer dependencies) from npm.
- vanilla-html → CDN
<script src="https://unpkg.com/@pagehub/sdk/dist/pagehub.umd.cjs">(the self-contained UMD bundle; React is vendored locally). - vite-react / nextjs →
@pagehub/sdkas an npm dependency, bundled by the app. The SDK has a broad peer-dependency surface (CodeMirror, TipTap, Leaflet, Framer Motion, …); both demos list them so the full editor works.
The React demos register a custom PricingCard via defineComponent and pass the
same components array to the editor, the viewer, and (in production) the static
renderToHTML() renderer. Define it once; it renders in all three.
- SDK: github.com/PageHubApp/sdk · npm
- PageHub: pagehub.dev