@potluckdb/potluckdb-browser
v0.1.0
Published
potluckdb browser application SDK and WASM runtime
Readme
potluckdb for the browser
potluckdb ships for the browser as one release target: the runtime compiled to WebAssembly, packaged with the worker that hosts it and the application API of the Node package. Databases live in the origin's private file system; a remote is a directory there or a bucket reached from the page.
Installation
npm install @potluckdb/potluckdb-browserThe package is an ES module. The server, in development and in
production, sends Cross-Origin-Opener-Policy: same-origin and
Cross-Origin-Embedder-Policy: require-corp with the page.
Usage
import { open, storage } from "@potluckdb/potluckdb-browser";
const credentials = async () => {
const response = await fetch("/api/storage-credentials");
return response.json(); // { accessKeyId, secretAccessKey, sessionToken, expiresAt }
};
const remote = await storage.fromS3({ bucket: "my-bucket", namespace: "notes", region: "eu-west-1", credentials });
const db = await open("app", remote);The trial and the license key
apply. A page has neither an environment nor a configuration
directory, so the license key is passed as the licenseKey open
option, and the trial's anchor is kept in the origin private file
system beside the databases.
The browser page gives the headers a page needs, buckets from a page, and the quickstart.
See LICENSE.
