Skip to content

Quick Start

This guide gets you from zero to a published version in five minutes, assuming you already have a developer token (dev_...). If you don't have one yet, see Don't have a token yet? at the bottom.

1. Install the CLI

bash
npm install -g packdog

2. Log in

bash
packdog login dev_<your-token>
packdog whoami

Token is stored at ~/.config/packdog/config.json and works from any directory.

3. Find your package and initialise it

bash
packdog list
# → shooter-game    be027d3c-747d-4080-a854-d9f12aa32a2f
# → quiz-pack       9f3a1b2c-...

# In the directory of the package you'll work on:
packdog init --id=be027d3c-747d-4080-a854-d9f12aa32a2f

This writes a packdog.json with the package id. The CLI reads this file from the current directory on every command.

4. Build and upload

Build your package to dist/ with whatever toolchain you use (Vite, esbuild, Rollup, plain tsc — Packdog doesn't care). The only requirement is that dist/ contains an index.js entry point.

bash
npm run build         # produces dist/index.js (project-specific)
packdog upload        # uploads dist/ as a new version, auto-publishes to stage

Output:

Uploaded: abc-123-def
Files: 3, Size: 45.2 KB
Published to stage: abc-123-def

5. Test and promote

Test the version on the stage channel. When you're ready, promote to stable:

bash
packdog publish       # latest version → stable

If something goes wrong:

bash
packdog rollback --channel=stable

That's the loop. upload → test on stage → publish to stable → rollback if needed.


Loading a package in the browser

The customer-side load uses your customer API key (blk_...):

javascript
const { index, baseUri } = await fetch(
  'https://api.packdog.dev/v1/packages/PACKAGE_ID/channels/stable',
  { headers: { 'Authorization': 'Bearer blk_yourkey' } }
).then(r => r.json());

const mod = await import(index);
mod.mount(document.getElementById('root'), { baseUri });

index is the URL to load. baseUri is what the loaded module uses internally to fetch its own assets. The customer key lives in browser JS by design — it's scoped to read-only loads of packages you've been granted access to.


Don't have a token yet?

Packdog is currently invitation-only. You need:

  • A customer API key (blk_...) to load packages from the browser.
  • A developer token (dev_...) to upload and publish from the CLI.

Both are issued by the Packdog operator out-of-band. Email post@jetbit.no and we'll set up your customer account, grant access to the packages you need, and create developer tokens for anyone who'll be uploading.


Next steps

Packdog runs on Cloudflare Workers, D1, and R2.