annotepage

The library & app, in Node

The server to embed or launch, and the client your pages load — both from npm, no PHP.

The developer page for annotepage in Node. Not what you came for?

What annotepage is

The server

Embed it in the app you already run, or launch it on its own.

  1. On npm

    The package: annotepage-server.

    npm install annotepage-server
  2. Embed it

    In the app you already run.

    A fetch handler — Express, Fastify, Bun, Deno, Workers.

    import { createServer } from 'annotepage-server';
    import { SqliteStore } from 'annotepage-server/stores/sqlite';
    import { nodeListener } from 'annotepage-server/adapters';
    
    const api = createServer({
        store: new SqliteStore({ file: './data/notes.sqlite' }),
        projects: { '<id>': { mode: 'encrypted' } },
    });
    app.use('/annotepage/api', nodeListener(api));
  3. Run it

    On its own, from a terminal.

    --help for the options.

    npx annotepage-server --project <id>

The client

The annotation layer your pages load: one file, one classic <script> tag — never bundled.

  1. On npm

    The package: annotepage-client.

    It hands you dist/annotepage.js — the file the tag loads, byte for byte.

    npm install annotepage-client
  2. Serve it

    Serve that one file from your app, and load it with a classic tag — not imported, not bundled.

    The install page builds the tag, with your address, your key and the digest.

    <script src="/annotepage/annotepage.js"
            data-server="/annotepage/api"
            data-key="<43 characters>"></script>

See a detailed usage example See every way to install it