Skip to content

Vanilla JS

From a CDN, no build step:

<script type="module" src="https://unpkg.com/shipdot@0.1"></script>
<ship-dot src="/shipdot.json"></ship-dot>

Or with a bundler (npm install shipdot):

main.js
import 'shipdot'
document.addEventListener('shipdot:read', (event) => console.log('Read:', event.detail.ids))

Run shipdot build before your bundler so public/shipdot.json exists:

package.json
{ "scripts": { "build": "shipdot build && vite build" } }

Full example: examples/vanilla.