Appearance
npm / yarn / pnpm
bash
npm install @maillune/sdkImport once — the custom element registers itself globally:
js
import '@maillune/sdk';
// <email-builder> is now available everywhere in your appCDN (UMD build)
No bundler required. Add the script tag and the element is ready to use:
html
<script src="https://cdn.jsdelivr.net/npm/@maillune/sdk/dist/email-builder.umd.js"></script>TypeScript
The package ships with full type definitions. To get types for the custom element's imperative API:
ts
import type { EmailBuilderElement } from '@maillune/sdk';
const builder = document.querySelector('email-builder') as EmailBuilderElement;
builder.load(myBlockTree);For React JSX typings, add to your globals.d.ts:
ts
import type { SdkConfig } from '@maillune/sdk';
declare global {
namespace JSX {
interface IntrinsicElements {
'email-builder': Partial<SdkConfig> & {
'api-key': string;
'user-id': string;
'template-id'?: string;
theme?: 'light' | 'dark' | 'auto';
ref?: React.Ref<EmailBuilderElement>;
};
}
}
}Browser support
The SDK uses standard Web Components (Custom Elements v1 + Shadow DOM v1). Supported in all modern browsers:
| Browser | Version |
|---|---|
| Chrome | 67+ |
| Firefox | 63+ |
| Safari | 12.1+ |
| Edge | 79+ |
WARNING
Internet Explorer is not supported.