TypeScript / JS SDK
ติดตั้ง Official TypeScript SDK จาก GitHub Packages:
npm install @techasit5415/microbase-sdkตัวอย่างการใช้งาน
Section titled “ตัวอย่างการใช้งาน”import Microbase from '@techasit5415/microbase-sdk';
const mb = new Microbase('http://localhost:3000');
// ล็อกอินผู้ใช้await mb.collection('users').authWithPassword('user@example.com', 'password123');
// ดึงรายการ recordsconst posts = await mb.collection('posts').getList(1, 20, { filter: 'published = true', sort: '-created_at', expand: 'author',});
// รับ event แบบ realtimeawait mb.collection('posts').subscribe('*', (e) => { console.log(e.action, e.record);});