SDKs overview

The monday.com API facilitates programmatic interaction with the monday.com Work OS, allowing developers to extend its functionality, automate workflows, and integrate with other business applications. The API is built on GraphQL, which provides a flexible query language for data retrieval and manipulation. To streamline development, monday.com offers official Software Development Kits (SDKs) for popular programming languages. These SDKs handle the complexities of GraphQL requests, authentication, and response parsing, enabling developers to focus on application logic rather than low-level API interactions. In addition to official SDKs, the monday.com developer community contributes various libraries and tools that can further assist in integration projects.

Using an SDK can reduce the amount of boilerplate code required to interact with an API. For instance, an SDK typically includes methods for common operations like fetching board items, updating columns, or creating new tasks, abstracting the direct GraphQL queries and mutations. This can lead to more maintainable and readable codebases, especially for developers working within the specific language ecosystem supported by the SDK. The monday.com API reference documentation details the available GraphQL schema, including queries, mutations, and subscriptions, which the SDKs are designed to interact with.

Official SDKs by language

monday.com provides official SDKs to support development in commonly used languages, streamlining the process of building applications and integrations. These SDKs are maintained by monday.com and are designed to provide a stable and officially supported interface to the API. The primary official SDKs available are for JavaScript and Python, reflecting their widespread use in web and backend development.

Language Package Name Install Command Maturity
JavaScript monday-sdk-js npm install monday-sdk-js or yarn add monday-sdk-js Stable, actively maintained
Python monday-sdk-python pip install monday-sdk-python Stable, actively maintained

These official SDKs are designed to encapsulate the complexities of the monday.com GraphQL API, offering helper functions and methods that map directly to common API operations. They also typically handle authentication, error handling, and request formatting, allowing developers to interact with the API using native language constructs. The choice between the JavaScript and Python SDKs often depends on the developer's existing tech stack and project requirements.

Installation

Installing the monday.com official SDKs involves using the standard package managers for JavaScript (npm or Yarn) and Python (pip).

JavaScript SDK

To integrate the monday.com JavaScript SDK into a project, developers can use either npm or Yarn. This SDK is suitable for both client-side applications (e.g., in monday.com apps) and server-side Node.js environments.

Using npm:

npm install monday-sdk-js

Using Yarn:

yarn add monday-sdk-js

After installation, the SDK can be imported into a JavaScript file:

import mondaySdk from "monday-sdk-js";
const monday = mondaySdk();

Python SDK

The Python SDK is installed using pip, Python's package installer. This SDK is typically used for backend services, scripts, and data processing applications that interact with monday.com.

Using pip:

pip install monday-sdk-python

Once installed, the SDK can be imported and initialized in a Python script:

from monday import MondayClient
monday = MondayClient("YOUR_API_V2_TOKEN")

It is important to replace "YOUR_API_V2_TOKEN" with an actual API token obtained from the monday.com platform. API tokens are used to authenticate requests and ensure that operations are authorized. For production environments, it is recommended to manage API tokens securely, typically by using environment variables or a secure secret management system, rather than hardcoding them directly into the source code, as described in common security practices like those outlined by Google Cloud's security best practices.

Quickstart example

This section provides a quickstart example demonstrating how to fetch data from monday.com using both the JavaScript and Python SDKs. The example focuses on querying a board to retrieve its name and the names of its items.

JavaScript Quickstart

This JavaScript example, suitable for a Node.js environment or a monday.com app context, queries the monday.com API to get a specific board's name and its items. Ensure you have installed monday-sdk-js and have an API token configured.

import mondaySdk from "monday-sdk-js";

// Initialize the SDK with your API token
// In a monday.com app, the token is often handled automatically.
// For external scripts, set it explicitly:
const monday = mondaySdk({
  token: process.env.MONDAY_API_TOKEN // Use environment variable for security
});

const BOARD_ID = 123456789; // Replace with your actual board ID

async function getBoardData() {
  try {
    const query = `query {
      boards (ids: ${BOARD_ID}) {
        name
        items_page {
          items {
            name
          }
        }
      }
    }`;

    const response = await monday.api(query);
    console.log("Board Data:", JSON.stringify(response.data, null, 2));

    if (response.data && response.data.boards && response.data.boards.length > 0) {
      const board = response.data.boards[0];
      console.log(`Board Name: ${board.name}`);
      board.items_page.items.forEach(item => {
        console.log(`- Item: ${item.name}`);
      });
    }
  } catch (error) {
    console.error("Error fetching board data:", error);
  }
}

getBoardData();

This code initializes the monday-sdk-js, constructs a GraphQL query to fetch board and item names, and then executes the query using the SDK's api method. The results are logged to the console.

Python Quickstart

This Python example performs the same operation: fetching a board's name and its items. Ensure you have installed monday-sdk-python and have your API token ready.

from monday import MondayClient
import os

# Initialize the SDK with your API token from an environment variable
monday = MondayClient(os.environ.get("MONDAY_API_TOKEN"))

BOARD_ID = 123456789  # Replace with your actual board ID

def get_board_data():
    query = f"""query {{
      boards (ids: {BOARD_ID}) {{
        name
        items_page {{
          items {{
            name
          }}
        }}
      }}
    }}"""

    try:
        response = monday.api(query)
        print("Board Data:", response)

        if response and response.get('data') and response['data'].get('boards'):
            board = response['data']['boards'][0]
            print(f"Board Name: {board['name']}")
            for item in board['items_page']['items']:
                print(f"- Item: {item['name']}")

    except Exception as e:
        print(f"Error fetching board data: {e}")

if __name__ == "__main__":
    get_board_data()

The Python script initializes the MondayClient with an API token, constructs the GraphQL query, and then uses the client's api method to execute it. The fetched data is then printed in a structured format. Both examples highlight how the SDKs simplify the process of making GraphQL calls to the monday.com API.

Community libraries

While monday.com provides official SDKs, the developer community also contributes various libraries and tools that can enhance the development experience. These community-driven projects typically aim to address specific use cases, provide additional abstractions, or extend functionality not covered by the official SDKs. Community libraries might include:

  • Specialized wrappers: Libraries optimized for specific frameworks or environments (e.g., React hooks for monday.com apps).
  • Utility functions: Collections of helper functions for common tasks like date manipulation, status column parsing, or complex data transformations.
  • CLI tools: Command-line interfaces for interacting with monday.com API for administrative tasks or rapid prototyping.
  • Integrations with third-party services: Libraries that simplify connecting monday.com data with other platforms.

Developers often discover community contributions through developer forums, GitHub, or other open-source repositories. When considering a community library, it is advisable to evaluate its maintenance status, community support, and compatibility with the latest monday.com API versions. The official monday.com developer documentation remains the authoritative source for API specifications and best practices, even when utilizing third-party tools. For instance, understanding the underlying GraphQL schema, as detailed in the monday.com API reference, is crucial for effectively using any SDK or library, whether official or community-maintained.