gearConfiguration

Configure the Platform SDK client with API keys, workspace ID, and optional base URL overrides.

The Platform SDK uses bearer token authentication. Every client instance is scoped to a single workspace.

Configuration Parameters

Parameter
Type
Required
Description

apiKey

string

API key from the Amigo dashboard

workspaceId

string

Workspace ID all requests are scoped to

baseUrl

string

Override the default https://api.platform.amigo.ai

Creating a Client

import { AmigoClient } from '@amigo-ai/platform-sdk'

const client = new AmigoClient({
  apiKey: 'your-api-key',
  workspaceId: 'your-workspace-id',
})

With a Custom Base URL

Use baseUrl to point to a regional or staging endpoint:

const client = new AmigoClient({
  apiKey: 'your-api-key',
  workspaceId: 'your-workspace-id',
  baseUrl: 'https://api.platform.amigo.ai', // default
})

Environment Variables

The recommended approach for production is to read credentials from environment variables rather than hardcoding them.

Corresponding .env file:

Separate Environments

Use separate .env files per environment:

Getting Your Credentials

API Key

Generate an API key from the Amigo dashboard:

  1. Log in at https://<your-org-id>.amigo.ai

  2. Navigate to Settings → API Keys

  3. Click Create API Key and optionally set an expiration date.

  4. Copy the key. It is only shown once.

circle-exclamation

Workspace ID

Your workspace ID appears in the dashboard URL:

It is also returned in every workspace-scoped API response under the workspace_id field.

Security Best Practices

  • Rotate API keys regularly. Set an expiration date and rotate before expiry.

  • Use read-only keys where possible. API keys inherit their creator's permissions.

  • One key per environment. Use separate keys for development, staging, and production.

  • Never log credentials. Avoid printing apiKey or config objects.

Next Steps

Last updated

Was this helpful?