Skip to main content

Overview

Integrate Copera into your development workflow with our official tools:
  • Backend SDK: Full-featured Node.js/TypeScript SDK for API integration
  • CI/CD: GitHub Actions for automated notifications in your workflows
Choose the integration method that best fits your needs.

Node.js SDK

@copera.ai/sdk

Official Node.js/TypeScript SDK for the Copera Public API

Installation

npm install @copera.ai/sdk

Requirements

  • Node.js 18 or higher
  • API Key from your Copera integration

Quick Start

import { CoperaAI } from '@copera.ai/sdk';

// Initialize the SDK
const copera = CoperaAI({
  apiKey: 'your-api-key-here'
});

// Send a message to a channel
await copera.channel.sendMessage({
  channelId: 'channel_id_here',
  message: 'Hello from Copera.ai SDK!',
  name: 'Bot Name' // optional
});

// List all boards
const boards = await copera.board.listBoards();
console.log(boards);

Available Methods

Channel Methods

Send a text message to a channel.
await copera.channel.sendMessage({
  channelId: 'channel_id',
  message: 'Your message here',
  name: 'Optional sender name'
});

Board Methods

Retrieve all boards in the workspace.
const boards = await copera.board.listBoards();
Get details of a specific board.
const board = await copera.board.getBoardDetails('board_id');
List all tables in a board.
const tables = await copera.board.listBoardTables('board_id');
Get details of a specific table.
const table = await copera.board.getBoardTable({
  boardId: 'board_id',
  tableId: 'table_id'
});
List all rows in a table.
const rows = await copera.board.listTableRows({
  boardId: 'board_id',
  tableId: 'table_id'
});
Get a specific row from a table.
const row = await copera.board.getTableRow({
  boardId: 'board_id',
  tableId: 'table_id',
  rowId: 'row_id'
});
Create a new row in a table.
const newRow = await copera.board.createTableRow({
  boardId: 'board_id',
  tableId: 'table_id',
  columns: [
    {
      columnId: 'column_id_1',
      value: 'Value 1'
    },
    {
      columnId: 'column_id_2',
      value: 'Value 2'
    }
  ],
  description: 'Optional description'
});

Environment Configuration

Development Environment

import { CoperaAI } from '@copera.ai/sdk';

const copera = CoperaAI({
  apiKey: process.env.COPERA_API_KEY,
  // SDK automatically uses production API
});

Sandbox Mode

For testing, you can use the sandbox environment:
const copera = CoperaAI({
  apiKey: process.env.COPERA_SANDBOX_API_KEY,
  sandbox: true
});

Error Handling

The SDK provides detailed error messages:
try {
  await copera.channel.sendMessage({
    channelId: 'invalid_id',
    message: 'Test message'
  });
} catch (error) {
  console.error('Error:', error.message);
  // Handle error appropriately
}

TypeScript Support

The SDK is built with TypeScript and provides full type definitions:
import type { Board, BoardTable, BoardTableRow } from '@copera.ai/sdk';

// All types are exported and available
const boards: Board[] = await copera.board.listBoards();

Need Help?

Found a bug or have a feature request?

Report an Issue

Open an issue on GitHub for the Node.js SDK

Support

Need help with the SDK or GitHub Action?

Coming Soon

We’re working on additional SDKs for:
  • Python
  • Go
  • PHP
  • Ruby
Stay tuned for updates!