Search
Get up and running faster than a yarn install âš¡
yarn install
Choose your favorite package manager:
# npm (the classic) npm install memofai # yarn (the hipster choice) yarn add memofai # pnpm (the fast one) pnpm add memofai
moa_...
import { createMoaClient } from 'memofai'; const client = createMoaClient({ apiToken: 'moa_your_token_here', environment: 'production' }); // You're ready to roll! 🎸
const { createMoaClient } = require('memofai'); const client = createMoaClient({ apiToken: 'moa_your_token_here', environment: 'production' });
import { createMoaClient } from 'memofai'; const client = createMoaClient({ apiToken: 'moa_your_token_here' });
The professional way:
# .env MEMOFAI_API_TOKEN=moa_your_token_here MEMOFAI_ENVIRONMENT=production
import { createMoaClient } from 'memofai'; const client = createMoaClient({ apiToken: process.env.MEMOFAI_API_TOKEN!, environment: process.env.MEMOFAI_ENVIRONMENT as any });
import { createMoaClient, Environment } from 'memofai'; const client = createMoaClient({ // Required apiToken: 'moa_your_token', // Optional environment: 'production' as Environment, // dev, alpha, beta, sandbox, production timeout: 30000, // Request timeout (ms) retries: 3, // Retry attempts retryDelay: 1000 // Delay between retries (ms) });
Add to your tsconfig.json:
tsconfig.json
{ "compilerOptions": { "target": "ES2020", "module": "ES2020", "lib": ["ES2020"], "moduleResolution": "node", "esModuleInterop": true, "skipLibCheck": true, "strict": true } }
Does it work? Let's find out!
import { createMoaClient } from 'memofai'; const client = createMoaClient({ apiToken: 'moa_your_token' }); // Try listing workspaces const workspaces = await client.workspaces.list(); console.log('✅ SDK working! Found', workspaces.length, 'workspaces');
SDK installed? Time to:
Let's build something cool! 🚀