JOLT SDK · API REFERENCE

jolt-sdk

Every exported class, interface, function, and type of the four SDK modules, generated from the committed typedoc output. Start with the SDK overview or the app development guide.

modulejolt-sdk

jolt-sdk: the TypeScript SDK for building applications on the Jolt network.

Layers, top to bottom:

  1. Client (createJoltClient): domain-shaped operations with tolerant reads. What applications program against.
  2. Operations: one typed function per stable daemon endpoint, for the rare call the client does not wrap.
  3. Transports: how requests reach the daemon. Import one from jolt-sdk/transport-http or jolt-sdk/transport-tauri, or the fake from jolt-sdk/testing.

Quick start (browser or Node.js):

import { createJoltClient } from "jolt-sdk";
import { HttpTransport } from "jolt-sdk/transport-http";

let token = "";
const jolt = createJoltClient({
  transport: new HttpTransport({ daemonUrl: "http://127.0.0.1:9862" }),
  getSessionToken: () => token,
});

const request = await jolt.requestSession({
  appId: "myapp.local",
  appName: "My App",
  appOrigin: "http://127.0.0.1:5173",
  identity: (await jolt.getStatus()).identity_address,
  capabilities: ["publish:/myapp/*", "resolve:public", "fetch:public"],
});
// ...poll jolt.getSessionRequestStatus(request.request_id) until it
// carries a session_token (the user approves in Jolt Console), then:
await jolt.publishJson("/myapp/hello", { hello: "world" });

References

re-exportSessionRequest

Re-export of index.operations.SessionRequest.

Namespaces

namespaceoperations

Typed daemon operations over a JoltTransport.

One function per daemon endpoint the application contract declares stable. These are the lowest app-facing layer: wire DTOs in and out, no domain marshalling. Most applications should use the client from createJoltClient instead and drop to operations only for endpoints the client does not wrap (e.g. binary publish).

typeSessionRequest

type SessionRequest = { ... }

What an app declares when opening a Jolt session.

PropertyTypeDescription
appIdstring
appNamestring
appOriginstring
capabilitiesreadonly string[]Requested capability strings, e.g. publish:/myapp/*.
identitystringThe identity whose authority the session requests.

functionacceptIngress

function acceptIngress(transport: JoltTransport, token: string, ingressId: string, options?: CallOptions): Promise<IngressRecord>

Accept a pending ingress envelope.

ParameterTypeNotes
transportJoltTransport
tokenstring
ingressIdstring
optionsCallOptionsoptional

functionappendPublishJson

function appendPublishJson(transport: JoltTransport, token: string, path: string, body: object, options?: CallOptions): Promise<PublishResponse>

Publish a coexisting device-writer append record at path. Append records never overwrite each other, so concurrent writers are safe; read them back with enumerate, never with resolve.

ParameterTypeNotes
transportJoltTransport
tokenstring
pathstring
bodyobject
optionsCallOptionsoptional

functiondecryptEncryptedTarget

function decryptEncryptedTarget(transport: JoltTransport, token: string, target: string, options?: CallOptions): Promise<DecryptedEncryptedObject>

Resolve + decrypt an encrypted publication addressed to this session's identity.

ParameterTypeNotes
transportJoltTransport
tokenstring
targetstring
optionsCallOptionsoptional

functionenumerate

function enumerate(transport: JoltTransport, token: string, identity: string, pathPrefix: string, options?: CallOptions): Promise<AppendRecordInfo[]>

List an identity's append records under a path prefix.

ParameterTypeNotes
transportJoltTransport
tokenstring
identitystring
pathPrefixstring
optionsCallOptionsoptional

functionfetchTarget

function fetchTarget(transport: JoltTransport, token: string, target: string, options?: CallOptions): Promise<FetchResult>

Fetch raw bytes by content id or address.

ParameterTypeNotes
transportJoltTransport
tokenstring
targetstring
optionsCallOptionsoptional

functiongetCurrentSession

function getCurrentSession(transport: JoltTransport, token: string, options?: CallOptions): Promise<CurrentAppSession>

The session behind a bearer token, as the daemon sees it.

ParameterTypeNotes
transportJoltTransport
tokenstring
optionsCallOptionsoptional

functiongetSessionRequestStatus

function getSessionRequestStatus(transport: JoltTransport, requestId: string, options?: CallOptions): Promise<AppSessionStatusResponse>

Poll a session request until it carries a session_token.

ParameterTypeNotes
transportJoltTransport
requestIdstring
optionsCallOptionsoptional

functiongetStatus

function getStatus(transport: JoltTransport, options?: CallOptions): Promise<NodeStatus>

Local daemon status: identity address, peer id, connectivity.

ParameterTypeNotes
transportJoltTransport
optionsCallOptionsoptional

functionlistPendingIngress

function listPendingIngress(transport: JoltTransport, token: string, options?: CallOptions): Promise<IngressRecord[]>

Pending ingress envelopes awaiting review.

ParameterTypeNotes
transportJoltTransport
tokenstring
optionsCallOptionsoptional

functionlistPublished

function listPublished(transport: JoltTransport, token: string, options?: CallOptions): Promise<PublishedContent[]>

This node's published inventory.

ParameterTypeNotes
transportJoltTransport
tokenstring
optionsCallOptionsoptional

functionopenIngress

function openIngress(transport: JoltTransport, token: string, ingressId: string, options?: CallOptions): Promise<DecryptedIngress>

Decrypt a pending ingress envelope without deciding it.

ParameterTypeNotes
transportJoltTransport
tokenstring
ingressIdstring
optionsCallOptionsoptional

functionpublishBytes

function publishBytes(transport: JoltTransport, token: string, path: string, bytes: Uint8Array<ArrayBufferLike>, meta: { fileName: string; mimeType: string }, options?: CallOptions): Promise<PublishResponse>

Publish raw bytes (images, media) at a signed path.

ParameterTypeNotes
transportJoltTransport
tokenstring
pathstring
bytesUint8Array<ArrayBufferLike>
meta{ fileName: string; mimeType: string }
optionsCallOptionsoptional

functionpublishEncryptedBytes

function publishEncryptedBytes(transport: JoltTransport, token: string, path: string, plaintext: Uint8Array<ArrayBufferLike>, meta: { mimeType: string; recipients: string[] }, options?: CallOptions): Promise<EncryptedPublishResponse>

Publish raw bytes encrypted to recipients.

ParameterTypeNotes
transportJoltTransport
tokenstring
pathstring
plaintextUint8Array<ArrayBufferLike>
meta{ mimeType: string; recipients: string[] }
optionsCallOptionsoptional

functionpublishEncryptedJson

function publishEncryptedJson(transport: JoltTransport, token: string, path: string, body: object, recipients: string[], options?: CallOptions): Promise<EncryptedPublishResponse>

Publish a JSON object encrypted to recipients (identity addresses).

ParameterTypeNotes
transportJoltTransport
tokenstring
pathstring
bodyobject
recipientsstring[]
optionsCallOptionsoptional

functionpublishJson

function publishJson(transport: JoltTransport, token: string, path: string, body: object, options?: CallOptions): Promise<PublishResponse>

Publish a JSON object at a signed path (last-writer-wins update log).

ParameterTypeNotes
transportJoltTransport
tokenstring
pathstring
bodyobject
optionsCallOptionsoptional

functionrejectIngress

function rejectIngress(transport: JoltTransport, token: string, ingressId: string, options?: CallOptions): Promise<IngressRecord>

Reject a pending ingress envelope.

ParameterTypeNotes
transportJoltTransport
tokenstring
ingressIdstring
optionsCallOptionsoptional

functionrequestSession

function requestSession(transport: JoltTransport, req: SessionRequest, options?: CallOptions): Promise<AppSessionRequestResponse>

Ask the daemon for a scoped session. The user approves it in Jolt Console.

ParameterTypeNotes
transportJoltTransport
reqSessionRequest
optionsCallOptionsoptional

functionresolveAddress

function resolveAddress(transport: JoltTransport, token: string, address: string, options?: CallOptions): Promise<ResolveResponse>

Resolve a .jolt address (identity + path) to its current content id.

ParameterTypeNotes
transportJoltTransport
tokenstring
addressstring
optionsCallOptionsoptional

functionsendIngress

function sendIngress(transport: JoltTransport, token: string, req: { encryptedObject: number[]; expiresAt?: number; recipient: string }, options?: CallOptions): Promise<IngressRecord>

Deliver an already-encrypted object to a recipient's daemon (/app/v1/ingress/send). Most apps should use the client's sendObject, which also publishes the sender's own encrypted copy.

ParameterTypeNotes
transportJoltTransport
tokenstring
req{ encryptedObject: number[]; expiresAt?: number; recipient: string }
optionsCallOptionsoptional

Classes

classJoltApiError

The daemon (or its dev proxy) answered with a non-success status.

The daemon's JSON error body, when present, is preserved on body and its error field becomes the message.

new JoltApiError

new JoltApiError(message: string, options?: { body?: unknown; code?: string; status?: number }): JoltApiError
ParameterTypeNotes
messagestring
options{ body?: unknown; code?: string; status?: number }defaults to {}
PropertyTypeDescription
readonly body?unknownThe raw parsed error body, for callers that need more than the message.
PropertyTypeDescription
cause?unknown
PropertyTypeDescription
readonly code?stringMachine-readable error code from the daemon body (e.g. app_session_unauthorized), when present.
PropertyTypeDescription
messagestring
PropertyTypeDescription
namestring
PropertyTypeDescription
stack?string
PropertyTypeDescription
readonly status?numberHTTP status code of the response, when the transport had one.

classJoltTransportError

The daemon could not be reached at all: connection refused, DNS failure, aborted request, or timeout. The cause carries the underlying error.

new JoltTransportError

new JoltTransportError(message: string, options?: { cause?: unknown }): JoltTransportError
ParameterTypeNotes
messagestring
options{ cause?: unknown }defaults to {}
PropertyTypeDescription
cause?unknown
PropertyTypeDescription
messagestring
PropertyTypeDescription
namestring
PropertyTypeDescription
stack?string

Interfaces

interfaceJoltAppendSdk

Coexisting append records and their enumeration.

enumerate

enumerate(identity: string, pathPrefix: string, options?: CallOptions): Promise<EnumeratedRecord[]>

List an identity's append records under a path prefix.

ParameterTypeNotes
identitystring
pathPrefixstring
optionsCallOptionsoptional

publishAppend

publishAppend(path: string, body: object, options?: CallOptions): Promise<PublishResult>

Publish a coexisting device-writer append record at path.

ParameterTypeNotes
pathstring
bodyobject
optionsCallOptionsoptional

interfaceJoltEncryptedSdk

Encrypted publish and tolerant encrypted reads.

listPublished

listPublished(options?: CallOptions): Promise<PublishedContent[]>

The local node's published inventory.

ParameterTypeNotes
optionsCallOptionsoptional

publishEncryptedJson

publishEncryptedJson(path: string, body: object, recipients: string[], options?: CallOptions): Promise<PublishResult>

Publish a JSON body encrypted to recipients (identity addresses). Use [self] for an encrypt-to-self publication; the publisher can always decrypt its own publications, so readEncrypted reads them back.

ParameterTypeNotes
pathstring
bodyobject
recipientsstring[]
optionsCallOptionsoptional

readEncrypted

readEncrypted<T>(ref: Reference, decode: Decoder<T>, options?: CallOptions): Promise<null | Versioned<T>>

Resolve + decrypt + parse + decode; null on any failing step.

ParameterTypeNotes
refReference
decodeDecoder<T>
optionsCallOptionsoptional

interfaceJoltIngressSdk

The recipient-controlled ingress door: deliver identified objects to another identity's daemon and review what arrives at yours. Transport-level vocabulary only; classifying payloads is the app's job.

acceptIngress

acceptIngress(ingressId: string, options?: CallOptions): Promise<void>
ParameterTypeNotes
ingressIdstring
optionsCallOptionsoptional

listPendingIngress

listPendingIngress(options?: CallOptions): Promise<IngressRecord[]>
ParameterTypeNotes
optionsCallOptionsoptional

openIngress

openIngress(ingressId: string, options?: CallOptions): Promise<unknown>

Decrypt a pending envelope and return its parsed JSON, or null.

ParameterTypeNotes
ingressIdstring
optionsCallOptionsoptional

rejectIngress

rejectIngress(ingressId: string, options?: CallOptions): Promise<void>
ParameterTypeNotes
ingressIdstring
optionsCallOptionsoptional

sendObject

sendObject(recipient: string, path: string, body: object, options?: CallOptions): Promise<PublishResult>

Encrypt-publish the object at path (the sender's own copy) and deliver it to recipient's daemon. Returns the publish result so the sender can version its own copy.

ParameterTypeNotes
recipientstring
pathstring
bodyobject
optionsCallOptionsoptional

interfaceJoltSdk

Public publish and tolerant versioned reads.

publishJson

publishJson(path: string, body: object, options?: CallOptions): Promise<PublishResult>

Publish a JSON object at a signed path (last-writer-wins).

ParameterTypeNotes
pathstring
bodyobject
optionsCallOptionsoptional

read

read<T>(ref: Reference, decode: Decoder<T>, options?: CallOptions): Promise<null | Versioned<T>>

Resolve, fetch, parse, and decode a publication. Returns null when the reference is missing/unreachable or the bytes do not decode to T.

ParameterTypeNotes
refReference
decodeDecoder<T>
optionsCallOptionsoptional

readContent

readContent<T>(contentId: string, ref: Reference, latestSequence: number, decode: Decoder<T>, options?: CallOptions): Promise<null | Versioned<T>>

Fetch a known content id (from an enumerated append record), then parse and decode it against the supplied logical reference.

ParameterTypeNotes
contentIdstring
refReference
latestSequencenumber
decodeDecoder<T>
optionsCallOptionsoptional

interfaceJoltSessionSdk

Session bootstrap and daemon status, bound to the client's transport.

getCurrentSession

getCurrentSession(options?: CallOptions): Promise<CurrentAppSession>

The session behind the current token, as the daemon sees it.

ParameterTypeNotes
optionsCallOptionsoptional

getSessionRequestStatus

getSessionRequestStatus(requestId: string, options?: CallOptions): Promise<AppSessionStatusResponse>

Poll a session request until it carries a token.

ParameterTypeNotes
requestIdstring
optionsCallOptionsoptional

getStatus

getStatus(options?: CallOptions): Promise<NodeStatus>

Local daemon status (no session required).

ParameterTypeNotes
optionsCallOptionsoptional

requestSession

requestSession(req: SessionRequest, options?: CallOptions): Promise<AppSessionRequestResponse>

Ask the daemon for a scoped session; the user approves it in Console.

ParameterTypeNotes
reqSessionRequest
optionsCallOptionsoptional

interfaceJoltTransport

The single interface a transport implements.

Implementations must throw JoltApiError for non-success daemon responses and JoltTransportError for network-level failures, so application error handling is uniform across runtimes.

request

request<T>(base: ApiBase, path: string, req?: TransportRequest): Promise<T>

Send a JSON request to base + path and parse the JSON response.

ParameterTypeNotes
baseApiBase
pathstring
reqTransportRequestoptional

upload

upload<T>(base: ApiBase, path: string, req: TransportUpload): Promise<T>

Send a multipart file upload to base + path and parse the JSON response.

ParameterTypeNotes
baseApiBase
pathstring
reqTransportUpload

Type Aliases

typeApiBase

type ApiBase = "app" | "daemon"

Which daemon API surface a request targets.

typeAppendRecordInfo

type AppendRecordInfo = { ... }

One device-writer append record as enumeration returns it (/app/v1/enumerate).

PropertyTypeDescription
content_idstring
created_atstring
device_idstring
device_sequencenumber
entry_hashstring
pathstring

typeAppSessionRequestResponse

type AppSessionRequestResponse = { ... }

Response to a session request (/app/v1/sessions/request).

PropertyTypeDescription
request_idstring
statusAppSessionStatus

typeAppSessionStatus

type AppSessionStatus = "pending" | "active" | "rejected" | "revoked" | "expired"

Lifecycle states of an app session.

typeAppSessionStatusResponse

type AppSessionStatusResponse = { ... }

Polled session request status (/app/v1/sessions/{request_id}).

PropertyTypeDescription
capabilitiesstring[]
expires_at?number | null
identity?string | null
request_idstring
session_id?string | null
session_token?string | null
statusAppSessionStatus

typeCallOptions

type CallOptions = { ... }

Options accepted by every SDK operation.

signal aborts the request; timeoutMs fails it with a JoltTransportError after the given time. Both may be combined.

PropertyTypeDescription
signal?AbortSignal
timeoutMs?number

typeCurrentAppSession

type CurrentAppSession = { ... }

The current session, as seen by the daemon (/app/v1/session).

PropertyTypeDescription
app_idstring
app_namestring
expires_at?number | null
granted_capabilitiesstring[]
identity?string | null
last_used_at?number | null
request_idstring
session_id?string | null
statusAppSessionStatus

typeDecoder

type Decoder<T> = (value: unknown) => T | null

A decoder is the app's schema-level reader: it validates an already-parsed JSON value into a canonical type, or returns null to reject it. Decoders never see bytes or transport concerns.

typeDecryptedEncryptedObject

type DecryptedEncryptedObject = { ... }

Decrypted encrypted publication (/app/v1/encrypted/decrypt).

PropertyTypeDescription
content_idstring
content_typestring
pathstring
plaintextnumber[]
sizenumber

typeDecryptedIngress

type DecryptedIngress = { ... }

Decrypted ingress payload (/app/v1/ingress/{id}/open).

PropertyTypeDescription
content_typestring
plaintextnumber[]
sizenumber

typeEncryptedPublishResponse

type EncryptedPublishResponse = PublishResponse & { ... }

Result of an encrypted publish (/app/v1/encrypted/publish).

PropertyTypeDescription
recipient_countnumber

typeEnumeratedRecord

type EnumeratedRecord = { ... }

One append record, marshalled into domain shape.

PropertyTypeDescription
contentIdstring
createdAtstring
deviceIdstring
deviceSequencenumber
entryHashstring
identitystring
pathstring

typeFetchResult

type FetchResult = { ... }

Raw bytes fetched by content id (/app/v1/fetch).

PropertyTypeDescription
content_idstring
datanumber[]
sizenumber

typeIngressRecord

type IngressRecord = { ... }

One recipient-controlled ingress envelope awaiting (or past) review.

PropertyTypeDescription
accepted_at?number | null
expires_at?number | null
ingress_idstring
received_atnumber
receiver_idstring
recipient_identitystring
rejected_at?number | null
schema_hint?string | null
sender_identitystring
sizenumber
status"pending" | "accepted" | "rejected"

typeJoltClient

type JoltClient = JoltSdk & JoltAppendSdk & JoltEncryptedSdk & JoltIngressSdk & JoltSessionSdk & { ... }

Everything a typical Jolt application needs, in one object.

PropertyTypeDescription
readonly transportJoltTransportThe transport backing this client, for operations the client does not wrap.

typeJoltClientOptions

type JoltClientOptions = { ... }

Configuration for createJoltClient.

PropertyTypeDescription
getSessionToken() => stringWhere the client finds the current session token. Called per request so token rotation needs no client rebuild.
transportJoltTransport

typeNodeStatus

type NodeStatus = { ... }

/api/v1/status: the local daemon's identity and connectivity summary.

PropertyTypeDescription
connected_peersnumber
daemon_version?string
identity_addressstring
peer_idstring
uptime_secsnumber

typePublishedContent

type PublishedContent = { ... }

One locally published item (/app/v1/published).

PropertyTypeDescription
address?string | null
content_idstring
local_sequence?number | null
path?string | null
pin_statestring
sizenumber

typePublishResponse

type PublishResponse = { ... }

Result of a public publish (/app/v1/publish).

PropertyTypeDescription
address?string | null
content_idstring
latest_sequence?number | null
path?string | null
sizenumber

typePublishResult

type PublishResult = { ... }

Result of any publish, in domain (camelCase) shape.

PropertyTypeDescription
addressstring | null
contentIdstring
latestSequencenumber
pathstring

typeReference

type Reference = { ... }

The stable identity of a publication: (identity, path).

PropertyTypeDescription
identitystring
pathstring

typeResolveResponse

type ResolveResponse = { ... }

Result of resolving a .jolt address (/app/v1/resolve).

PropertyTypeDescription
addressstring
content_idstring
identitystring
latest_sequencenumber
pathstring
reachability_hintsunknown[]
sourcestring

typeTransportRequest

type TransportRequest = CallOptions & { ... }

A JSON (or empty-body) request.

PropertyTypeDescription
json?unknownJSON body; omitted for GET.
method?"GET" | "POST" | "DELETE"
token?string | nullBearer session token, when the endpoint needs one.

typeTransportUpload

type TransportUpload = CallOptions & { ... }

A multipart upload request (public publish and append).

PropertyTypeDescription
bytesUint8Array
fileNamestring
mimeTypestring
pathstringThe logical Jolt path form field.
tokenstring

typeVersioned

type Versioned<T> = { ... }

A versioned, decoded publication: what a read hands back to the app.

PropertyTypeDescription
contentIdstring
latestSequencenumber
refReference
valueT

Functions

functionapiErrorMessage

function apiErrorMessage(error: unknown): string

Map any error thrown by the SDK to a short human-readable message suitable for an app's error banner. Never throws.

ParameterTypeNotes
errorunknown

functioncreateJoltClient

function createJoltClient(options: JoltClientOptions): JoltClient

Build a JoltClient over a transport and a session-token source.

ParameterTypeNotes
optionsJoltClientOptions

functionmakeId

function makeId(prefix: string): string

Generate a collision-resistant id with an app-chosen prefix.

ParameterTypeNotes
prefixstring

functionreferenceKey

function referenceKey(ref: Reference): string

A stable string key for a Reference, for maps and stores.

ParameterTypeNotes
refReference

functionreferenceTarget

function referenceTarget(ref: Reference): string

The .jolt address a Reference resolves through.

ParameterTypeNotes
refReference

modulejolt-sdk/transport-http

HTTP transport: reach a Jolt daemon over fetch.

Works in browsers and Node.js 18+. Point it at the daemon directly (new HttpTransport({ daemonUrl: "http://127.0.0.1:9862" })) or, for browser dev servers that proxy the daemon to dodge CORS, at proxy base paths (HttpTransport.viteProxy() uses /jolt-api and /jolt-daemon, the convention Spoke's vite config established).

Classes

classHttpTransport

class HttpTransport implements JoltTransport

The fetch-based transport: reaches the daemon directly by URL, or through dev-server proxy paths via HttpTransport.viteProxy.

new HttpTransport

new HttpTransport(options?: HttpTransportOptions): HttpTransport
ParameterTypeNotes
optionsHttpTransportOptionsdefaults to {}

request

request<T>(base: ApiBase, path: string, req?: TransportRequest): Promise<T>

Send a JSON request to base + path and parse the JSON response.

ParameterTypeNotes
baseApiBase
pathstring
reqTransportRequestdefaults to {}

upload

upload<T>(base: ApiBase, path: string, req: TransportUpload): Promise<T>

Send a multipart file upload to base + path and parse the JSON response.

ParameterTypeNotes
baseApiBase
pathstring
reqTransportUpload

viteProxy

static viteProxy(options?: Omit<HttpTransportOptions, "bases" | "daemonUrl">): HttpTransport

The browser dev-server preset: requests go to the /jolt-api (app API) and /jolt-daemon (daemon API) proxy paths on the current origin.

ParameterTypeNotes
optionsOmit<HttpTransportOptions, "bases" | "daemonUrl">defaults to {}

Type Aliases

typeHttpTransportOptions

type HttpTransportOptions = { ... }

Configuration for HttpTransport.

PropertyTypeDescription
bases?{ app: string; daemon: string }Explicit base paths/URLs per API surface, overriding daemonUrl. Useful behind dev-server proxies.
daemonUrl?stringBase URL of the daemon, e.g. http://127.0.0.1:9862. The transport derives /app/v1 and /api/v1 from it.
defaultTimeoutMs?numberDefault timeout applied when a call passes none.

modulejolt-sdk/transport-tauri

Tauri transport: reach the Jolt daemon through a desktop shell's Rust commands instead of direct HTTP, so the webview never needs network access to the daemon.

The host application must expose these Tauri commands (the contract Spoke established):

#[tauri::command]
async fn daemon_request(base_path: String, path: String, method: String,
                        body: Option<Value>, session_token: Option<String>)
                        -> Result<Value, String>;
#[tauri::command]
async fn daemon_publish_bytes(session_token: String, path: String,
                              bytes: Vec<u8>, file_name: String,
                              mime_type: String) -> Result<Value, String>;
#[tauri::command]
async fn daemon_append(session_token: String, path: String, bytes: Vec<u8>,
                       file_name: String, mime_type: String)
                       -> Result<Value, String>;

See the app development guide for the full Rust implementation to copy.

Classes

classTauriTransport

class TauriTransport implements JoltTransport

The Tauri transport: routes every request through the host shell's Rust commands (tauri-plugin-jolt in plugin mode, or app-defined commands).

new TauriTransport

new TauriTransport(options?: TauriTransportOptions): TauriTransport
ParameterTypeNotes
optionsTauriTransportOptionsdefaults to {}

request

request<T>(base: ApiBase, path: string, req?: TransportRequest): Promise<T>

Send a JSON request to base + path and parse the JSON response.

ParameterTypeNotes
baseApiBase
pathstring
reqTransportRequestdefaults to {}

upload

upload<T>(base: ApiBase, path: string, req: TransportUpload): Promise<T>

Send a multipart file upload to base + path and parse the JSON response.

ParameterTypeNotes
baseApiBase
pathstring
reqTransportUpload

Type Aliases

typeTauriTransportOptions

type TauriTransportOptions = { ... }

Configuration for TauriTransport.

PropertyTypeDescription
plugin?booleanInvoke the commands provided by the tauri-plugin-jolt Rust plugin (plugin:jolt|daemon_request etc.) instead of app-defined commands. Recommended: add tauri_plugin_jolt::init() to your Tauri builder and the jolt:default capability, and no hand-written Rust proxy is needed.

Functions

functionisTauriRuntime

function isTauriRuntime(): boolean

True when running inside a Tauri webview. Use this to choose between TauriTransport and an HTTP transport in apps that also run in a plain browser during development.

modulejolt-sdk/testing

Deterministic in-memory fakes for testing Jolt applications.

createFakeJolt returns a fully working JoltClient implementation with no daemon and no network: publishes land in an in-memory store keyed by path, reads resolve against it, ingress sends are recorded, and incoming envelopes can be injected. Encryption is simulated (recipients are recorded, plaintext is stored), which is exactly what app-level tests need: they test their own schemas and flows, not HPKE.

References

re-exportreferenceKey

Re-export of index.referenceKey.

Type Aliases

typeFakeJolt

type FakeJolt = { ... }

Handle returned by createFakeJolt.

PropertyTypeDescription
clientJoltClientThe fake client; pass it anywhere a JoltClient (or any of its sub-interfaces) is expected.
encryptedRecipientsMap<string, string[]>Every encrypted publish's recipients, keyed by path.
identitystringThe local identity the fake publishes under.
sentRecordedSend[]Every object sent with sendObject, in order.
deliverIngress(input: { body: unknown; schemaHint?: string; sender: string }) => IngressRecordInject a pending ingress envelope, as if a remote sender delivered it. Returns the created record so tests can accept/reject/open it.

typeRecordedSend

type RecordedSend = { ... }

An ingress send recorded by the fake.

PropertyTypeDescription
bodyunknown
pathstring
recipientstring

Functions

functioncreateFakeJolt

function createFakeJolt(identity: string): FakeJolt

Create an in-memory fake Jolt for one identity.

const { client, deliverIngress, sent } = createFakeJolt("alice.jolt");
await client.publishJson("/myapp/profile", { name: "Alice" });
const got = await client.read(
  { identity: "alice.jolt", path: "/myapp/profile" },
  (v) => v as { name: string }
);
ParameterTypeNotes
identitystring