@lettera/email-builder
v0.1.0
Published
Single-entrypoint meta-package that bundles the Lettera core, renderer, SDK, standard blocks, and React editor.
Maintainers
Readme
@lettera/email-builder
Meta-package that bundles the entire Lettera stack behind a single import. Most integrators only need this package.
pnpm add @lettera/email-builder react react-domimport { LetteraEditor, usePersistence } from '@lettera/email-builder';
import { render, BlockRegistry, standardBlocks } from '@lettera/email-builder/server';
import '@lettera/editor/styles.css';Entrypoints
| Entrypoint | Exports | React required? |
| --- | --- | --- |
| . (default) | Everything | Yes |
| ./server | @lettera/core, @lettera/renderer, @lettera/sdk, standardBlocks, StandardBlocks namespace | No |
| ./editor | @lettera/editor (component + store + hooks) | Yes |
| ./hooks | usePersistence, useVersions, usePreview + types | Yes |
| ./styles.css | Editor stylesheet | — |
Why split entrypoints?
A Node worker that only renders emails has no business shipping React or
Tiptap. Import from /server and your bundle contains only the
renderer + core + SDK.
Naming ambiguity
RepeaterBlock / ConditionalBlock mean two different things in the
stack:
- Schema type (from
@lettera/core) — the shape of the node insideEmailDocument. - Block definition (from
@lettera/blocks-standard) — the runtime descriptor registered with the renderer.
The meta-package re-exports the schema types by their original names and puts the block definitions under a namespace to avoid the clash:
import { RepeaterBlock } from '@lettera/email-builder'; // schema type
import { StandardBlocks } from '@lettera/email-builder';
const repeater = StandardBlocks.RepeaterBlock; // block def
registry.registerAll(standardBlocks); // arrayDocumentation
See the repository root for guides on getting started, integration, variables, and custom blocks.
