name: ago-setup
description: Set up the AGO SDK (@useago/sdk) in any JavaScript/TypeScript project. Installs the package, configures the client, and verifies the connection. Keywords: ago, sdk, install, setup, init, configure, integrate.
allowed-tools: Read, Write, Edit, Glob, Grep, Bash
/ago-setup - Set Up AGO SDK
Installs and configures @useago/sdk in the user's project.
Usage
/ago-setup
Steps
1. Detect the project type
- Look for
package.json to confirm it's a JS/TS project
- Check if React is a dependency (enables React-specific setup)
- Check the package manager (npm, yarn, pnpm) by looking for lock files
2. Install the SDK
npm install @useago/sdk
3. Create the AGO client configuration
Create a file (e.g., src/lib/ago.ts or src/ago.ts) with the client setup:
import { AgoClient } from "@useago/sdk";
export const agoClient = new AgoClient({
baseUrl: import.meta.env.VITE_AGO_BASE_URL ?? process.env.NEXT_PUBLIC_AGO_BASE_URL ?? "",
});
Adapt the env var pattern to the project's framework (Vite, Next.js, CRA, etc.).
4. Add environment variables
Add to .env (or .env.local):
VITE_AGO_BASE_URL=https://YOUR-DOMAIN.useago.com
Add the same keys (without values) to .env.example if it exists.
5. If React is detected, also set up the provider
Create or update the app's root to include AgoProvider:
import { AgoProvider } from "@useago/sdk/react";
import { agoClient } from "./lib/ago";
<AgoProvider client={agoClient}>
{children}
</AgoProvider>
6. Verify
- Run typecheck to confirm no import errors
- Tell the user to set their AGO base URL in the env file
SDK Reference
AgoClient Configuration
interface AgoConfig {
baseUrl: string;
defaultAgentId?: string;
userEmail?: string;
userJwt?: string;
debug?: boolean;
}
Zero-Config Alternative
If the project uses window.AGO or meta tags, the SDK can auto-detect config:
import { createAgo } from "@useago/sdk";
const client = createAgo();
Important
- Do NOT hardcode credentials in source files
- Always use environment variables
- Ask the user for their AGO instance URL if not found in env