@linkvite/js is generated from the Linkvite OpenAPI spec: every endpoint has a typed method, and request and response types match the API. It works anywhere with fetch: Node 20+, Deno, Bun, browsers and browser extensions.
Create a client
Call the API
Methods are grouped by resource (bookmarks, collections, highlights, …). Path parameters come first, then the request body, then query parameters. Every method resolves to the response’s data.
linkvite.request('GET', '/v1/...').
OAuth helpers
Theoauth namespace implements the authorization code flow with PKCE:
singleFlightRefresher handles that, and onUnauthorized retries a request once with the new token:
Errors and retries
Failed requests throw aLinkviteError with status, errors (validation details) and requestId. Idempotent requests are retried on 429, 5xx and network errors, honouring Retry-After.