@pagehub/sdk is PageHub's shared chrome and site utilities: the modal and confirm dialog, popover hooks, the media upload pipeline, the Tailwind + DaisyUI CSS compile, the default theme tokens, icon resolution and the email CSS helpers. The source is public at PageHubApp/sdk.
It has no editor and no page renderer. To embed the visual editor in your own app, use @pagehub/editor (see Developers).
Terminal
What it ships
| Import | What it is |
|---|---|
@pagehub/sdk/chrome/floating/Modal | The one dialog shell. See Modal. |
@pagehub/sdk/chrome/primitives/layout/useConfirm | Promise-based confirm: if (!(await ask({...}))) return;. See Modal. |
@pagehub/sdk/compile-css | compileCSS({ classes, themeCSS }): the CSS a page needs, built from the classes it uses. Server only. See CSS compile. |
@pagehub/sdk/theme.css | The default design tokens. See Theme. |
@pagehub/sdk/themes/shadcn.css | Maps those tokens to your shadcn palette. See Theme. |
@pagehub/sdk/chrome.css | Styles for the chrome above. See Chrome stylesheet. |
@pagehub/sdk/email-renderer | buildEmailCss and htmlToText: turn your email markup into CSS an email client keeps, plus a plain-text version. See Email renderer. |
@pagehub/sdk/page-settings/fields | The list of a page's settings and their defaults. See Page settings fields. |
@pagehub/sdk/utils/* | Media upload, CDN URLs, page slugs, path patterns, SEO schema, icon resolution, safe HTML. |
The npm package ships compiled ESM and .d.ts files. The server-side helpers need Node 20.16 or newer. tailwindcss and daisyui are peers of the CSS compile; the CodeMirror packages, prettier and @floating-ui/react-dom are optional peers for the code inputs and popovers.
Docs
- Modal — dialogs and confirms
- CSS compile —
compileCSS - Theme — tokens,
theme.css, the shadcn bridge - Email renderer — email-safe CSS and plain text
- Chrome stylesheet —
chrome.css - Page settings fields —
page-settings/fields