Skip to content

TypeScript / JS SDK

Install the official TypeScript SDK from GitHub Packages:

Terminal window
npm install @techasit5415/microbase-sdk
import Microbase from '@techasit5415/microbase-sdk';
const mb = new Microbase('http://localhost:3000');
// Authenticate a user
await mb.collection('users').authWithPassword('user@example.com', 'password123');
// Query records
const posts = await mb.collection('posts').getList(1, 20, {
filter: 'published = true',
sort: '-created_at',
expand: 'author',
});
// Subscribe to realtime updates
await mb.collection('posts').subscribe('*', (e) => {
console.log(e.action, e.record);
});