Getting Started

Get up and running with a11ops in under 5 minutes. This guide will walk you through installation, configuration, and sending your first alert.

Quick Start

The fastest way to get started with a11ops is using our Node.js SDK. Install it with npm or yarn:

npm install @a11ops/sdk

That's it! The SDK will automatically prompt you to set up your API key on first use. Send your first alert with just two lines of code:

import { a11ops } from '@a11ops/sdk';

await a11ops.alert({
  title: "My first alert!",
  priority: "info"
});

Installation

Node.js / JavaScript

# Using npm
npm install @a11ops/sdk

# Using yarn  
yarn add @a11ops/sdk

# Using pnpm
pnpm add @a11ops/sdk

Requires Node.js 14.0 or higher. Full TypeScript support included.

Python (Coming Soon)

pip install a11ops

Go (Coming Soon)

go get github.com/a11ops/go-sdk

Configuration

Development Setup

During development, the SDK will automatically prompt you to enter your API key when you first run your application. The key will be securely stored in your home directory at ~/.a11ops/config.json.

$ node app.js
🚨 a11ops SDK: No API key found!
? Enter your a11ops API key: ********************************
✅ API key saved to ~/.a11ops/config.json

Production Setup

In production, set the A11OPS_API_KEY environment variable:

# .env file
A11OPS_API_KEY=your-api-key-here

# Or export directly
export A11OPS_API_KEY=your-api-key-here

Advanced Configuration

For more control, you can use the class-based API:

import A11ops from '@a11ops/sdk';

const client = new A11ops('your-api-key', {
  baseUrl: 'https://api.a11ops.com',
  region: 'us-west-2',
  timeout: 30000,
  retries: 3,
  retryDelay: 1000
});

await client.alert({
  title: "Custom client alert",
  priority: "high"
});

Sending Alerts

Basic Alert

await a11ops.alert({
  title: "Database connection lost",
  priority: "critical"
});

Severity Helpers

Use convenient severity methods for common alert types:

// Critical - Immediate attention required
await a11ops.critical("Payment system down!");

// Error - High priority issues
await a11ops.error("Failed to process order", "Order ID: 12345");

// Warning - Warning conditions
await a11ops.warning("High memory usage", "Server using 85% RAM");

// Info - Informational messages
await a11ops.info("Deployment completed", "Version 2.0.1 live");

Detailed Alert with Metadata

Include custom metadata for better context:

await a11ops.alert({
  title: "API Rate Limit Exceeded",
  message: "Customer API hitting rate limits",
  priority: "high",
  metadata: {
    customerId: "cust_123",
    endpoint: "/api/v1/orders",
    requests: 1523,
    limit: 1000,
    period: "1 hour",
    ip: "192.168.1.100"
  }
});

Next Steps

Need Help?

Join our community or reach out to our support team.