Skip to content

Installation

Terminal window
npm install pagepal

pagepal has no dependencies. It ships ES modules and CommonJS, with TypeScript types included.

No build step needed. The script-tag build includes everything, puts the API on window.PagePal, and registers the <page-pal> element:

<script src="https://unpkg.com/pagepal"></script>
<page-pal watch="form#signup" requests></page-pal>

or, from JavaScript:

<script src="https://unpkg.com/pagepal"></script>
<script>
PagePal.createPal({ watch: 'form#signup', requests: true });
</script>

Import only what you use. Each entry point is tree-shakable, and they share code, so importing several never duplicates the core.

ImportWhat it gives you
pagepalcreatePal() with every watcher, characters, types
pagepal/corecreatePalCore() with no watchers, for smaller bundles
pagepal/watchersIndividual watchers: forms(), requests(), deadClicks(), …
pagepal/charactersblob, cat, ghost, defineCharacter()
pagepal/analyticsanalytics(), summarize(), adapters
pagepal/debugdebugPanel()
pagepal/elementRegisters <page-pal>
pagepal/reactReact components and hooks
pagepal/vueVue component and composable

pagepal targets evergreen browsers (Chrome, Edge, Firefox, Safari). It relies on Shadow DOM, color-mix() and the individual translate/rotate CSS properties. On the server it does nothing: see server-side rendering.

The pal in the corner is pagepal itself.