Skip to content

Installation

Alap is a single package with zero required dependencies. Framework adapters are included but only activate when you import them — bring your own framework.

npm

bash
npm install alap

What you get

Import pathWhat it gives youPeer dependencies
alapEngine + DOM adapter + Web ComponentNone
alap/coreEngine + parser only (no DOM)None
alap/react<AlapProvider>, <AlapLink>, useAlap()react, react-dom
alap/vue<AlapProvider>, <AlapLink>, useAlap()vue
alap/svelte<AlapProvider>, <AlapLink>, useAlap()svelte
alap/solidAlapProvider, AlapLink, useAlap()solid-js
alap/astroAlapLink.astro, AlapSetup.astroastro
alap/alpinealapPlugin, x-alap directivealpinejs
alap/qwikAlapProvider, AlapLink, useAlap()@builder.io/qwik
alap/storageIndexedDB + Remote + Hybrid persistenceidb (optional)

Your bundler tree-shakes everything you don't import.

CDN (no build step)

No npm, no bundler. Load the IIFE build from a CDN or local file:

html
<script src="https://cdn.jsdelivr.net/npm/alap@3/dist/alap.iife.js"></script>

What's on window.Alap:

ExportWhat
defineAlapLink()Register the <alap-link> custom element
registerConfig(config, name?)Feed a config to the web component registry
updateRegisteredConfig(config, name?)Update a previously registered config
AlapLinkElementThe custom element class
AlapUIDOM adapter — new AlapUI(config, selector)
AlapEngineProgrammatic engine — new AlapEngine(config)
validateConfig(raw)Sanitize untrusted configs
mergeConfigs(...configs)Compose multiple configs into one

Size: ~27 KB (8.2 KB gzipped)

Works with static HTML, WordPress, Drupal, Shopify, GitHub Pages, Hugo, Jekyll, CodePen — anywhere you can add a <script> tag.

Peer dependencies

Install only the ones for your framework:

bash
npm install react react-dom    # for alap/react
npm install vue                # for alap/vue
npm install svelte             # for alap/svelte
npm install solid-js           # for alap/solid
npm install idb                # for alap/storage (IndexedDB only)

All peer dependencies are optional. If you import an adapter without its framework, you get a clear error telling you what to install.

Environment compatibility

ImportBrowserNode.jsNotes
alap/coreYesYesPure logic, zero DOM references
alapYesNoWeb component uses HTMLElement, customElements
alap/reactYesSSR*Needs React DOM
alap/vueYesSSR*Needs Vue runtime
alap/svelteYesSSR*Needs Svelte runtime
alap/solidYesSSR*Needs SolidJS runtime
alap/alpineYesNoNeeds document
alap/qwikYesSSR*Needs Qwik runtime
alap/astroYesYesThin wrapper
alap/storageYesPartial**IndexedDB needs browser; RemoteStore works anywhere

* Framework adapters work in SSR contexts (Next.js, Nuxt, SvelteKit) where the framework provides its own server-side DOM abstraction.

** createRemoteStore() works in Node.js (uses fetch). createIndexedDBStore() requires a browser.

Plugins & Integrations

Separate packages for specific platforms and content pipelines:

PackageWhatInstall
remark-alapMarkdown → <alap-link>npm install remark-alap
rehype-alapHTML/CMS content → <alap-link>npm install rehype-alap
@alap/mdxMDX with React providernpm install @alap/mdx
@alap/tiptapTiptap/ProseMirror extensionnpm install @alap/tiptap
astro-alapAstro integration (zero-config)npm install astro-alap
eleventy-alapEleventy plugin (shortcodes + filters)npm install eleventy-alap
qwik-alapQwik City integration (Vite plugin)npm install qwik-alap
next-alapNext.js App Router ('use client' + layout)npm install next-alap
nuxt-alapNuxt 3 (client plugin + Nuxt Content)npm install nuxt-alap

For WordPress, see the WordPress plugin (no npm — PHP plugin with Docker containers). For Hugo, see the Hugo integration (shortcodes + web component).

For contributors

bash
git clone <repo>
cd alap
pnpm install    # installs everything needed for development
pnpm test       # runs all tests across core, UI, and storage