The official browser client for JayDB Cloud. Build collaborative, multi-user web apps with zero backend servers — powered by OIDC PKCE authentication and optimistic concurrency control (CAS).
npm install @jaydb/cloud
| Bundle | Format | Size | Target & Usage | Copy Snippet |
|---|---|---|---|---|
jaydb-cloud.esm.min.js
Recommended
|
ESM | ~12.4 KB | Modern browser <script type="module"> & native importmaps |
|
jaydb-cloud.min.js
|
IIFE / UMD | ~12.8 KB | Classic script tags (exposes window.JayDBCloud) |
|
jaydb-cloud.esm.js
|
ESM | 27.6 KB | Unminified ESM bundle with sourcemaps for debugging |
|
index.d.ts
|
Types | 5.3 KB | TypeScript type declarations and interface definitions |
|
No Node.js, bundlers, or build tools required. Add this importmap to your HTML:
<!-- 1. Define standard module importmap -->
<script type="importmap">
{
"imports": {
"@jaydb/cloud": "https://jaydb-cloud.github.io/jaydb-cloud-sdk/jaydb-cloud.esm.min.js"
}
}
</script>
<!-- 2. Use pure ES modules -->
<script type="module">
import { JayDB, Auth } from '@jaydb/cloud';
const auth = new Auth({
tenant: 'acme',
clientId: 'my-app',
redirectUri: window.location.origin + '/callback'
});
const db = new JayDB({
tenant: 'acme',
namespace: 'production',
auth
});
// Read document with optimistic concurrency control (CAS)
const doc = await db.get('boards/main');
console.log('Loaded board:', doc?.data);
</script>