@malv/base-web
v1.1.10
Published
Browser-compatible implementations of MALV capabilities.
Downloads
27
Maintainers
Readme
@malv/base-web
Browser-compatible implementations of MALV capabilities.
Purpose
Provides storage implementations for web clients that need to interact with the MALV platform from the browser.
Installation
yarn add @malv/base-webExports
Web Storage (./storage)
IndexedDB-based local storage for browser persistence:
import { WebStorage } from '@malv/base-web/storage';
const storage = new WebStorage('my-db', '/chats/conversation-123/');
await storage.put('data.json', { foo: 'bar' });
const data = await storage.get('data.json');
const files = await storage.list('');Cloud Storage (./cloud-storage)
Proxied storage that calls the MALV storage service:
import { CloudStorage } from '@malv/base-web/cloud-storage';
const storage = new CloudStorage({
storageServiceUrl: 'http://localhost:59459/storage',
token: signedToken
});
await storage.put('/private/myapp/data.json', { foo: 'bar' });
const data = await storage.get('/private/myapp/data.json');Key Differences from @malv/base
- No Node.js-specific APIs
- Browser-compatible crypto
- Proxied storage (calls storage service instead of direct R2 access)
- IndexedDB for local persistence
Dependencies
@malv/types- Core type definitions@anthropic-ai/sdk- Claude AI (browser build)openai- OpenAI (browser build)
License
ISC
