SDKs overview

Base is primarily designed as a no-code/low-code platform that enables users to create data-driven applications and automate workflows without extensive programming knowledge. While the core experience is visual, Base provides programmatic access through its API, allowing developers to integrate Base functionalities into custom applications. Software Development Kits (SDKs) and libraries facilitate this integration by providing pre-built functions and abstractions for common API operations.

The SDKs abstract away direct HTTP requests, authentication, and response parsing, offering a more idiomatic way to interact with the Base platform from various programming languages. This approach helps reduce development time and potential errors when building integrations or extending Base's capabilities programmatically. While Base emphasizes a visual development environment, its API and accompanying SDKs support scenarios requiring custom backend logic, data synchronization, or integration with other systems.

Official SDKs by language

Base offers official SDKs for several popular programming languages, designed to streamline interaction with its API. These SDKs typically handle authentication, request formatting, and response parsing, allowing developers to focus on application logic rather than low-level API communication. The availability of official SDKs indicates Base's commitment to supporting developers who wish to extend or integrate with their platform programmatically, despite its no-code primary focus.

The following table outlines the officially supported SDKs, their respective package managers, and their general maturity status:

Language Package Name Install Command (Example) Maturity
JavaScript @base-ai/sdk npm install @base-ai/sdk or yarn add @base-ai/sdk Stable
Python base-sdk pip install base-sdk Stable
Go github.com/base-ai/go-sdk go get github.com/base-ai/go-sdk Beta

These SDKs provide methods for common operations such as creating, reading, updating, and deleting records within Base databases, as well as triggering workflows and managing application settings. For detailed API documentation and specific method calls, developers should refer to the official Base API reference.

Installation

Installing Base SDKs involves using the standard package manager for each respective programming language. Each SDK is published to its language's primary package repository, ensuring ease of access and version management. Before installation, ensure that you have the correct language runtime and package manager installed on your system.

JavaScript

For JavaScript projects, the Base SDK is available via npm. Navigate to your project directory and execute one of the following commands:

npm install @base-ai/sdk

Or, if you use Yarn:

yarn add @base-ai/sdk

This command adds the @base-ai/sdk package to your project's dependencies, making it available for import in your JavaScript or TypeScript files. The Mozilla Developer Network provides comprehensive JavaScript documentation for further reference on environment setup.

Python

The Python SDK for Base can be installed using pip, Python's package installer. It is recommended to use a virtual environment for Python projects to manage dependencies effectively.

pip install base-sdk

After installation, you can import the base_sdk module into your Python scripts. More information on Python package management can be found in the pip documentation.

Go

For Go projects, the SDK is typically fetched using the go get command, which downloads the package and its dependencies into your Go module cache.

go get github.com/base-ai/go-sdk

Once fetched, you can import the package into your Go source files. The official Go documentation on module management offers more details.

Quickstart example

This quickstart example demonstrates how to initialize the Base SDK and perform a basic operation, such as fetching records from a database table. Replace placeholder values with your actual Base API key and database identifiers. This example focuses on the JavaScript SDK, but similar patterns apply to Python and Go.

JavaScript Example

First, ensure you have your Base API key. You can find this in your Base account settings or API documentation. Store your API key securely, preferably using environment variables, and avoid hardcoding it directly in your source code.

import { BaseClient } from '@base-ai/sdk';

// Initialize the Base client with your API key
const client = new BaseClient({
  apiKey: process.env.BASE_API_KEY, // It is recommended to use environment variables for API keys
});

async function fetchRecords() {
  try {
    // Replace 'your_database_id' and 'your_table_name' with actual values
    const databaseId = 'your_database_id';
    const tableName = 'your_table_name';

    // Fetch records from a specific table
    const records = await client.database(databaseId).table(tableName).find();

    console.log('Fetched records:', records);

    // Example: Create a new record
    const newRecord = await client.database(databaseId).table(tableName).create({
      data: {
        'Name': 'New Item',
        'Status': 'Active'
      }
    });
    console.log('Created new record:', newRecord);

  } catch (error) {
    console.error('Error interacting with Base:', error);
  }
}

fetchRecords();

This example demonstrates how to instantiate the BaseClient and then use its fluent interface to interact with a specific database and table. The find() method retrieves records, and the create() method adds a new one. Error handling is included to catch potential issues during API calls. For more advanced queries, filtering, and data manipulation, consult the official JavaScript SDK documentation.

Community libraries

Given Base's primary focus on a no-code/low-code development experience, the ecosystem of community-contributed SDKs and libraries is less extensive compared to platforms with a code-first approach. Most programmatic interactions are expected to occur through the official SDKs or direct API calls. However, as Base gains wider adoption, community members may develop tools or wrappers to address specific use cases or provide integrations with other popular frameworks.

Community libraries typically emerge to fill gaps in official support, offer alternative language bindings, or integrate with niche platforms. These may include:

  • Framework-specific connectors: Libraries that simplify integration with popular web frameworks (e.g., React, Vue, Angular) or backend frameworks (e.g., Django, Ruby on Rails) by providing higher-level components or ORM-like abstractions.
  • CLI tools: Command-line interfaces that allow developers to manage Base resources (e.g., databases, tables, workflows) directly from their terminal.
  • Specialized data transformers: Utilities designed to convert data between Base's format and other common data formats or external services.
  • Integrations with niche services: Custom connectors for services not covered by Base's native integrations.

Developers interested in contributing to the Base ecosystem or seeking community-driven solutions can often find discussions and projects on platforms like GitHub, Reddit, or dedicated developer forums. It is advisable to check the official Base community channels for any listed community projects or discussion forums where such libraries might be shared. When using community-developed libraries, it is important to assess their maintenance status, documentation, and security practices, as they may not carry the same level of support or guarantees as official SDKs.