Skip to content
45 changes: 35 additions & 10 deletions docs/sdk/build-in-browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<!-- verification:
source_repo: ant-browser-sdk
source_ref: v0.1.2
source_commit: a29a87cf8d8f696ae5e8b22d6ee4f91d4e7bfbb0
verified_date: 2026-10-16
source_ref: v0.1.4
source_commit: 5199100c15527bf657ae4a795c2bdf5d086981f7
verified_date: 2026-10-27
verification_mode: target-manifest
-->

Expand All @@ -26,7 +26,8 @@ The SDK gives your web application access to stored content. You choose how to p
| Image gallery | Retrieve images and display them with ordinary browser elements |
| Audio or video player | Read media progressively and support seeking without downloading the entire file first |
| Data viewer | Retrieve a stored dataset or JSON file and present it as tables, charts or another application view |
| File-sharing application | Let users retrieve public files or authorize paid uploads from the browser |
| File-sharing application | Upload files, then share them as links or manifests that others can open |
| Updatable catalogue or profile | Keep one lasting address while the content behind it changes |

These are application patterns, not ready-made interfaces included in the SDK. For example, a book reader still needs code that understands the book's format and displays its pages. The SDK supplies access to the file's data.

Expand Down Expand Up @@ -61,21 +62,45 @@ Private files require their DataMap, the information needed to locate and decryp

For a complete working example, follow [Retrieve Data in the Browser](how-to-guides/retrieve-data-in-browser.md). It downloads a public image and displays it in a small web page.

## Streaming and larger files
## Choosing how to retrieve a file

You do not have to load every file into memory before using it. The SDK provides range reads and streams, so an application can request parts of a file as it needs them.
Choose the approach that matches the file and what your application needs to do with it:

For seekable audio and video, the SDK provides a service worker: a browser-managed script that connects a media element's requests to the SDK's file reader. This setup requires HTTPS or localhost and the application's page to remain open. Applications with an existing service worker must integrate the media handling with it.
- **Download it in one operation.** `download()` returns the complete file as bytes and a browser `Blob`; `downloadAndSave()` also opens a save flow for the user. Both hold the complete file in memory. They refuse files over 1 GB by default, but you can change that memory budget. The returned `Blob`, resolved DataMap, caches and network buffers need additional memory beyond the byte-array budget.
- **Save it as it arrives.** `streamAndSave()` writes directly to a destination selected by your application or the user. It does not create a complete in-memory copy, and streaming has no fixed file-size cap. The device still needs enough storage for the file.
- **Read only the parts you need.** `openFile()` provides range reads and a stream for applications such as document readers, archives and data viewers. Your application decides where those pieces go and how to present them.

Browser SDK 0.1.2 accepts files from 3 bytes up to 1 GB (1,000,000,000 bytes) for uploads, downloads, range reads, and media.
For seekable audio and video, the SDK provides a service worker: a browser-managed script that connects a media element's requests to the SDK's file reader. Deploy the service worker shipped with the same SDK version as your application. This setup requires HTTPS or localhost and the application's page to remain open. Applications with an existing service worker must integrate the media handling with it.

Whole-file downloads and uploads from byte arrays may run out of browser memory well before that limit. Choose range reads or the media integration when loading the whole file would be unsuitable. The [browser SDK API documentation](https://github.com/WithAutonomi/ant-browser-sdk/tree/v0.1.2#random-access-reads) covers range reads, media setup and file-size limits.
See the released SDK documentation for [whole-file downloads and saves](https://github.com/WithAutonomi/ant-browser-sdk/tree/v0.1.4#download-and-save), [streaming saves](https://github.com/WithAutonomi/ant-browser-sdk/tree/v0.1.4#streaming-saves), [range reads](https://github.com/WithAutonomi/ant-browser-sdk/tree/v0.1.4#random-access-reads) and [seekable media](https://github.com/WithAutonomi/ant-browser-sdk/tree/v0.1.4#seekable-media).

## Uploading from a browser

The SDK also accepts browser files and byte arrays for public or private uploads. Your application supplies a payment provider to authorize storage payments; supported integrations include Ethers and Wagmi/Viem. A read-only application does not need these wallet integrations.

File uploads have additional browser requirements, including a worker for file processing and IndexedDB for temporary storage. Use the [browser SDK's upload documentation](https://github.com/WithAutonomi/ant-browser-sdk/tree/v0.1.2#upload-files) when adding uploads and payment handling.
Uploads can be from 3 bytes up to 1 GB (1,000,000,000 bytes). Uploading a browser `File` or `Blob` processes it in a background worker and stages encrypted records in browser storage. Uploading a byte array holds the complete input in memory, so it may fail before reaching the upload limit.

If an upload fails partway through, the wallet may already have paid, so starting again could pay twice. In the same page, the SDK retains the prepared input and payment history so the user can resume or discard the failed attempt. For recovery after a reload, retain or reselect the same input and resume with the durable checkpoint that the SDK saves in IndexedDB by default. Check the original wallet to determine whether an unresolved payment went through. This check never authorizes another payment.

Use the released SDK's [upload documentation](https://github.com/WithAutonomi/ant-browser-sdk/tree/v0.1.4#upload-files) and [upload recovery guidance](https://github.com/WithAutonomi/ant-browser-sdk/tree/v0.1.4#resume-a-failed-upload) when adding uploads and payment handling.

## Sharing files with manifests

An `ant://` link can identify one public file or carry a manifest that describes multiple files. A `.ant` file carries the same kind of manifest: a portable list of file names and the information needed to retrieve each one.

Creating a manifest does not upload anything. The manifest is not stored on the Autonomi Network either: the `ant://manifest/...` link or `.ant` file is the manifest, and sharing it gives another person the information needed to retrieve its entries.

Public entries contain an address. An embedded entry contains the DataMap needed to read a private file. Anyone who receives a manifest with an embedded entry receives access to that private file, so protect that manifest as you would protect the DataMap itself.

See the released SDK documentation for [opening manifests and `ant://` links](https://github.com/WithAutonomi/ant-browser-sdk/tree/v0.1.4#manifests-and-ant-links) and [creating manifests and share links](https://github.com/WithAutonomi/ant-browser-sdk/tree/v0.1.4#creating-manifests-and-share-links).

## Keeping a reference up to date

A pointer gives your application one lasting address whose content can change. This is useful for a profile, catalogue or other record people return to.

The pointer is controlled by its owner seed. Keep that seed safe and keep a durable copy: without it, you cannot update the pointer. Each create or update costs a storage payment. If a paid update is interrupted, the SDK can often finish it without charging again, but only if your application saved its recovery checkpoint first. If a crash hid the transaction identity, reconcile the original wallet and do not start a fresh write while payment is unresolved. Nodes accept a recovered payment proof only while its quotes are less than a day old; after that, the update needs a new payment. Pointer ownership can also be transferred permanently.

A successful write does not establish finality. Only a `final` result from the pointer finality check means the responsible node group agreed with every peer answering and no rival final state. Read the released SDK's [pointer and recovery documentation](https://github.com/WithAutonomi/ant-browser-sdk/tree/v0.1.4#pointers-and-payment-recovery) before adding pointer writes.

## Network compatibility

Expand Down
7 changes: 4 additions & 3 deletions docs/sdk/how-to-guides/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

<!-- verification:
source_repo: ant-browser-sdk
source_ref: v0.1.2
source_commit: a29a87cf8d8f696ae5e8b22d6ee4f91d4e7bfbb0
verified_date: 2026-10-16
source_ref: v0.1.4
source_commit: 5199100c15527bf657ae4a795c2bdf5d086981f7
verified_date: 2026-10-27
verification_mode: target-manifest
-->

Expand All @@ -37,5 +37,6 @@ These guides use [antd](../use-antd.md), the local background service. For a fir

## Next steps

- [Browser SDK](../build-in-browser.md): understand direct browser connections, share links and manifests, large-file retrieval, uploads and updatable pointers.
- [Build with the SDKs](../install.md)
- [SDK Reference](../reference/README.md)
16 changes: 8 additions & 8 deletions docs/sdk/how-to-guides/retrieve-data-in-browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<!-- verification:
source_repo: ant-browser-sdk
source_ref: v0.1.2
source_commit: a29a87cf8d8f696ae5e8b22d6ee4f91d4e7bfbb0
verified_date: 2026-10-16
source_ref: v0.1.4
source_commit: 5199100c15527bf657ae4a795c2bdf5d086981f7
verified_date: 2026-10-27
verification_mode: target-manifest
-->

Expand All @@ -30,16 +30,16 @@ This example only reads existing public data. It does not configure a wallet or

Vite serves the JavaScript and WASM assets during development and bundles them for deployment.

This tutorial uses browser SDK 0.1.2 and Vite 8.2.0. The commands save these exact versions so reinstalling the project does not select a different version of either package.
This tutorial uses browser SDK 0.1.4 and Vite 8.3.5. The commands save these exact versions so reinstalling the project does not select a different version of either package.

In a terminal, run:

```bash
mkdir autonomi-browser-demo
cd autonomi-browser-demo
npm init -y
npm install --save-exact @withautonomi/ant-browser-sdk@0.1.2
npm install --save-dev --save-exact vite@8.2.0
npm install --save-exact @withautonomi/ant-browser-sdk@0.1.4
npm install --save-dev --save-exact vite@8.3.5
```

### 2. Add the page
Expand Down Expand Up @@ -174,7 +174,7 @@ The browser retrieves the data directly from Autonomi nodes. Vite serves your ap

## Next steps

- [Browser SDK documentation](https://github.com/WithAutonomi/ant-browser-sdk/tree/v0.1.2): upload, wallet, private-file and media APIs for the same experimental release.
- [Browser SDK](../build-in-browser.md): capabilities, application ideas and how browser connections work.
- [Browser SDK](../build-in-browser.md): understand browser connections, share links and manifests, large-file retrieval, uploads and updatable pointers.
- [Released Browser SDK documentation](https://github.com/WithAutonomi/ant-browser-sdk/tree/v0.1.4): complete examples and API details for the same experimental release.
- [Build with the SDKs](../install.md): compare application connection options.
- [Keys, Addresses, and DataMaps](../../core-concepts/keys-addresses-and-datamaps.md): understand public addresses and private-file access.
12 changes: 6 additions & 6 deletions docs/sdk/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

<!-- verification:
source_repo: ant-browser-sdk
source_ref: v0.1.2
source_commit: a29a87cf8d8f696ae5e8b22d6ee4f91d4e7bfbb0
verified_date: 2026-10-16
source_ref: v0.1.4
source_commit: 5199100c15527bf657ae4a795c2bdf5d086981f7
verified_date: 2026-10-27
verification_mode: target-manifest
-->

Expand All @@ -25,7 +25,7 @@ Choose based on where your application runs and whether you want it to manage it
| Connection | Choose it when | Installation and usage |
|------------|----------------|------------------------|
| Direct from a native application | You are building in Python, Node.js or .NET and want no separate network service to start | [Native SDKs](native/README.md) |
| Direct from the browser using WebAssembly (WASM) | You are building a web application that accesses data through the experimental browser SDK | [Browser SDK](build-in-browser.md) |
| Direct from the browser using WebAssembly (WASM) | You are building a web application that reads, streams, shares or stores data through the experimental browser SDK | [Browser SDK](build-in-browser.md) |
| Through a local daemon | Several applications should share one service, or you prefer a local REST or gRPC API | [Local-Daemon Clients](use-antd.md) |

The packages and APIs differ. Use the package for the connection arrangement you choose; a Python or Node.js library for one is not interchangeable with the other.
Expand All @@ -44,7 +44,7 @@ Each language reference covers installation and its API. Python and Node.js also

## Browser applications

Use `@withautonomi/ant-browser-sdk` to connect directly from JavaScript or TypeScript running in a browser. WebAssembly runs the network client; WebRTC carries its connections to nodes. Visitors do not need a local daemon.
Use `@withautonomi/ant-browser-sdk` to connect directly from JavaScript or TypeScript running in a browser. WebAssembly runs the network client; WebRTC carries its connections to nodes. Visitors do not need a local daemon. Applications can work with individual files, manifests and updatable pointers, and can stream large files without holding the complete file in memory.

The browser SDK is experimental. Read the [Browser SDK overview](build-in-browser.md) for capabilities and application ideas, then follow [Retrieve Data in the Browser](how-to-guides/retrieve-data-in-browser.md) for a complete public-image example.

Expand Down Expand Up @@ -72,7 +72,7 @@ Uploads require a wallet and storage payment. Choose public storage when you wan

## Related pages

- [Browser SDK](build-in-browser.md): build web applications with direct access to stored data.
- [Browser SDK](build-in-browser.md): read, share, stream and store data directly from a web application.
- [SDK How-To Guides](how-to-guides/README.md)
- [SDK Reference](reference/README.md)
- [Use the CLI](../cli/use-the-cli.md) for command-line access
Expand Down
10 changes: 5 additions & 5 deletions docs/sdk/reference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@

<!-- verification:
source_repo: ant-browser-sdk
source_ref: v0.1.2
source_commit: a29a87cf8d8f696ae5e8b22d6ee4f91d4e7bfbb0
verified_date: 2026-10-16
source_ref: v0.1.4
source_commit: 5199100c15527bf657ae4a795c2bdf5d086981f7
verified_date: 2026-10-27
verification_mode: target-manifest
-->

Find the methods, parameters, return values, and errors for the library or API you are using.

For native libraries that connect directly to the Autonomi Network, use the [native SDK reference](native-sdks.md). For web applications, [Browser SDK](../build-in-browser.md) introduces the separate experimental package and links to its API documentation. For client libraries that send requests to a local daemon, a separate background service called [antd](../use-antd.md), use [Language Bindings](language-bindings/README.md). The REST and gRPC references cover that service's APIs.
For native libraries that connect directly to the Autonomi Network, use the [native SDK reference](native-sdks.md). For web applications, [Browser SDK](../build-in-browser.md) introduces the separate experimental package, explains files, manifests, links, streams and pointers, and links to the released API documentation. For client libraries that send requests to a local daemon, a separate background service called [antd](../use-antd.md), use [Language Bindings](language-bindings/README.md). The REST and gRPC references cover that service's APIs.

The APIs are not interchangeable. Each reference describes its own constructors, supported operations, and limits.

Expand All @@ -33,7 +33,7 @@ The APIs are not interchangeable. Each reference describes its own constructors,
- [Node.js SDK](../native/nodejs.md): installation, a public-read example, types, and errors.
- [.NET SDK](../native/csharp.md): installation, methods, types, and errors.
- [Native SDK Reference](native-sdks.md): data, file, wallet, and external-signer APIs.
- [Browser SDK](../build-in-browser.md): the experimental browser package and links to its API documentation.
- [Browser SDK](../build-in-browser.md): the experimental browser package, its major developer tasks and links to its released API documentation.

## Local service and clients

Expand Down
8 changes: 4 additions & 4 deletions docs/sdk/reference/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

<!-- verification:
source_repo: ant-browser-sdk
source_ref: v0.1.2
source_commit: a29a87cf8d8f696ae5e8b22d6ee4f91d4e7bfbb0
verified_date: 2026-10-16
source_ref: v0.1.4
source_commit: 5199100c15527bf657ae4a795c2bdf5d086981f7
verified_date: 2026-10-27
verification_mode: target-manifest
-->

Expand Down Expand Up @@ -46,7 +46,7 @@ The compiled library is loaded by your application, not run as a separate comman

## Connecting directly from a browser

The browser SDK includes a network client compiled to WebAssembly (WASM). Your web application calls it from JavaScript or TypeScript, and WebRTC connects it directly to nodes. There is no local daemon to start. See [Browser SDK](../build-in-browser.md) for capabilities and [Retrieve Data in the Browser](../how-to-guides/retrieve-data-in-browser.md) for a complete example.
The browser SDK includes a network client compiled to WebAssembly (WASM). Your web application calls it from JavaScript or TypeScript, and WebRTC connects it directly to nodes. There is no local daemon to start. It can retrieve and store files, open or create shareable manifests and `ant://` links, stream large files and use pointers for content that changes behind a stable address. See [Browser SDK](../build-in-browser.md) for these capabilities and [Retrieve Data in the Browser](../how-to-guides/retrieve-data-in-browser.md) for a complete public-read example.

## Connecting through a local daemon

Expand Down
Loading
Loading