NPM Package
Integrate MindStudio's AI Agents into your Node.js projects.
Quick Start
1. Install the Package
npm install mindstudio2. Get Your API Key
3. Choose Your Usage Pattern
Option A: Type-Safe Usage (Recommended)
**// Initialize the client
const client = new MindStudio(process.env.MINDSTUDIO_KEY);
// Execute a workflow
const { success, result } = await client.workers.myWorker.generateText({
prompt: "Write a story about a space cat"
});
// Handle the response
if (success) {
console.log(result);
}**Option B: Direct Usage
Response Format
CLI Commands
sync
synctest
testlist
listTeam Usage
1. Project Owner:
2. Team Members:
Optional: Add to package.json for automatic type generation:
package.json for automatic type generation:Installation & Setup
Environment Variables
Option 1: In your shell
Option 2: In your .env file
Option 3: Pass directly to your CLI commands
For security best practices:
TypeScript Configuration
Error Handling
Common Issues
"Type-safe workers not available"
"API key is required"
"Failed to load configuration"
Best Practices
1. API Key Security
2. Type Safety
3. Error Handling
License
Last updated