Love Letter (TypeScript)
    Preparing search index...

    Love Letter (TypeScript)

    loveletter-web

    CI License: MIT

    The Web (TypeScript) SDK in the Love Letter family. It turns in-app feedback into a GitHub issue — in the exact same byte-for-byte wire format as the Apple and Android SDKs.

    Status: all four packages build, typecheck, and pass their suites (including the cross-platform conformance gate). npm publishing is in progress — until then, install from this workspace.

    Package Purpose
    @loveletter/core Framework-agnostic: wire format + RelayTransport / DirectGitHubTransport
    @loveletter/widget Drop-in, dependency-free feedback form (mountFeedbackWidget)
    @loveletter/react <FeedbackForm> React wrapper
    @loveletter/relay The server-side handler you deploy (Cloudflare / Firebase / Appwrite / generic fetch)

    A browser can't safely hold a writable GitHub token — anything in client JS is public. So on the web the default path is a relay you deploy and whose token you hold; the browser only ever talks to your endpoint. The SDK ships reference relay handlers, but you run them. See the security model and relay guide.

    import { mountFeedbackWidget } from '@loveletter/widget'
    import { RelayTransport } from '@loveletter/core'

    mountFeedbackWidget(el, {
    transport: new RelayTransport({ endpoint: '/api/feedback' }),
    appName: 'Acme',
    appVersion: '1.0.0',
    })

    A direct-to-GitHub transport exists for internal tools and prototypes, gated behind an explicit dangerouslyUseClientToken flag — it throws without it.

    Every Love Letter SDK emits an identical GitHub issue body, pinned by a shared spec and a golden-fixture conformance suite (loveletter-spec) that runs in this repo's CI.

    corepack enable
    pnpm install
    pnpm -r test # vitest, incl. the conformance gate in @loveletter/core
    pnpm -r typecheck

    API reference: https://hayek.github.io/loveletter-docs/reference/typescript/

    MIT © Amir Hayek. See LICENSE.