What the SDK ships

Every import in @pagehub/sdk and where its docs are.

On this page

@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
npm install @pagehub/sdk

What it ships

ImportWhat it is
@pagehub/sdk/chrome/floating/ModalThe one dialog shell. See Modal.
@pagehub/sdk/chrome/primitives/layout/useConfirmPromise-based confirm: if (!(await ask({...}))) return;. See Modal.
@pagehub/sdk/compile-csscompileCSS({ classes, themeCSS }): the CSS a page needs, built from the classes it uses. Server only. See CSS compile.
@pagehub/sdk/theme.cssThe default design tokens. See Theme.
@pagehub/sdk/themes/shadcn.cssMaps those tokens to your shadcn palette. See Theme.
@pagehub/sdk/chrome.cssStyles for the chrome above. See Chrome stylesheet.
@pagehub/sdk/email-rendererbuildEmailCss and htmlToText: turn your email markup into CSS an email client keeps, plus a plain-text version. See Email renderer.
@pagehub/sdk/page-settings/fieldsThe 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