Quick Start Guide
Get up and running with OpenPets in under 5 minutes. This guide will walk you through installing your first agent and making your first API call.
Prerequisites
- Node.js 18 or later
- npm, yarn, or pnpm
- A code editor (VS Code recommended)
Step 1: Install an Agent
Choose any agent from our directory and install it using your preferred package manager:
# Using npm
npm install @openpets/slack # Using pnpm
pnpm add @openpets/slack # Using yarn
yarn add @openpets/slack Step 2: Configure Environment Variables
Create a .env file in your project root and add the required API keys:
# .env
SLACK_TOKEN=xoxb-your-bot-token
SLACK_ENABLE_POSTING=true ℹ️
Finding API Keys
Each agent's documentation page lists the required environment variables and where to obtain them. Check the agent's page for specific instructions.
Step 3: Use the Agent
Import and use the agent in your code:
import { createSlackAgent } from '@openpets/slack';
// Initialize the agent
const slack = createSlackAgent();
// List all channels
const channels = await slack.listChannels();
console.log('Channels:', channels);
// Send a message
await slack.sendMessage({
channel: '#general',
text: 'Hello from OpenPets! 🐾'
});
// Search messages
const results = await slack.searchMessages({
query: 'project update',
limit: 10
}); Step 4: Run Your Code
Execute your script and watch the magic happen:
npx tsx index.ts