XmtpElixirSdk.BrowserShim
(xmtp_elixir_sdk v0.1.2)
Copy Markdown
Browser-shim contracts for browser-only SDK work.
Most of the SDK is designed to run in Elixir. This namespace exists only for the pieces that must be handled by a browser runtime, such as worker messaging or browser-managed storage.
It keeps the contract small and explicit:
- typed action envelopes for worker-style messaging
- a minimal async stream primitive
- request builders for the OPFS adapter surface
If you are building a server-only integration, you can usually ignore this namespace.
Summary
Functions
Build a failed browser-shim response envelope.
Generate a unique request or stream id for browser-shim traffic.
Build a browser-shim request envelope.
Build a successful browser-shim response envelope.
Build a streamed error envelope from the browser shim.
Build a streamed event envelope from the browser shim.
Types
Functions
@spec error(action_name(), String.t(), term()) :: XmtpElixirSdk.BrowserShim.Action.Error.t()
Build a failed browser-shim response envelope.
@spec id() :: String.t()
Generate a unique request or stream id for browser-shim traffic.
@spec request(action_name(), term()) :: XmtpElixirSdk.BrowserShim.Action.Request.t()
Build a browser-shim request envelope.
@spec response(action_name(), String.t(), term()) :: XmtpElixirSdk.BrowserShim.Action.Response.t()
Build a successful browser-shim response envelope.
@spec stream_error(action_name(), stream_id(), term()) :: XmtpElixirSdk.BrowserShim.Action.StreamError.t()
Build a streamed error envelope from the browser shim.
@spec stream_event(action_name(), stream_id(), term()) :: XmtpElixirSdk.BrowserShim.Action.StreamEvent.t()
Build a streamed event envelope from the browser shim.