inklet docs

Client

Constructing the inklet client — options, defaults, resources, and the low-level request method.

import { Inklet } from "@inklethq/sdk";

const inklet = new Inklet({ pat: process.env.INKLET_PAT! });

Inklet is an alias of InkletClient; both are exported and identical.

Options

Prop

Type

OptionDefaultNotes
patPersonal access token. Required (or secretKey).
secretKeyCompatibility alias for pat. Do not pass both.
baseUrlhttps://dev.iminklet.comAbsolute HTTP(S) URL, no credentials, query, or fragment.
fetchglobalThis.fetchMust match the standard signature.

Construction is validated but makes no network request. It throws ConfigurationError for a missing or malformed token, a bad baseUrl, both credentials at once, or a runtime with no fetch; and BrowserEnvironmentError if a document exists.

Properties

PropertyType
baseUrlstring — normalized, trailing slashes removed
assetsAssetsResource
contentsContentsResource
displaysDisplaysResource
presentationsPresentationsResource
pushPushResource — see Pushing content

Constants

import {
  DEFAULT_INKLET_BASE_URL, // "https://dev.iminklet.com"
  MAX_ASSET_SIZE_BYTES,    // 10485760 (10 MiB)
  MAX_ASSETS_PER_CONTENT,  // 50
  ALLOWED_IMAGE_CONTENT_TYPES,
  ALLOWED_FILE_CONTENT_TYPES,
} from "@inklethq/sdk";

request()

The transport used by every resource is public, for endpoints the typed resources do not cover yet:

const data = await inklet.request<MyType>("/api/sdk/v1/displays");

Prop

Type

Pass json to send a JSON body — it sets content-type and serializes for you. Passing both json and a non-null body throws.

Every request automatically carries authorization: Bearer … and accept: application/json, and sets redirect: "error".

Paths must be relative to baseUrl. Absolute URLs, protocol-relative paths (//host), backslashes, and anything resolving to a different origin throw ConfigurationError rather than being sent.

Responses are parsed as JSON when the content type says so; 204, 205, HEAD, and empty bodies resolve to undefined. Non-JSON bodies resolve as text.

API surface

All typed resources sit under one prefix:

/api/sdk/v1
MethodPath
GET/displays
GET/displays/{id}
GET/displays/{id}/queue
GET/displays/{id}/current-presentation
GET/presentations/{id}
POST/contents
GET/contents
GET/contents/{id}
POST/contents/{id}/confirm
POST/contents/{id}/upload-tickets

On this page