Skip to main content

Client SDK

The Squid Client SDK is a TypeScript library that enables client applications to connect to the Squid server and securely access the various services provided by Squid.

The Squid Client SDK is the primary way your apps interface with Squid features, including Squid AI solutions, database and API integrations, authentication, and more.

The Client SDK connects you to your databases so you can:

It also connects you to your API integrations so you can:

Additionally, the Client SDK works in partnership with the Squid Backend SDK to:

Most of the Client SDK functionality is local-first, meaning that updates to a database record are immediately reflected locally and subsequently synced to the server. This allows Squid to provide real-time updates for your applications.

Note

The Client SDK is available for both frontend and custom backend development. This allows you to use the SDK both in your frontend applications and backend functions, allowing for better code sharing and a simplified development process.

OOn the Squid backend, the Client SDK is readily available without needing initialization. You can directly access it using this.squid inside your backend functions.

Client SDK setup

Use npm to install the Client SDK:

npm install @squidcloud/client

The Squid client can be used across different frameworks and platforms. To initialize the Squid client, import the Squid class from the SDK and create an instance of the Squid client by passing your appId and region as configuration options. For local development, you will also need to include your environmentId and squidDeveloperId:

Client code
import { Squid } from '@squidcloud/client';

// Initialize the Squid client with your app configuration
const squid = new Squid({ appId: 'YOUR_APP_ID', region: 'YOUR_REGION' });

The Squid class serves as the primary entry point for the Squid Client SDK, offering a comprehensive array of functionality for accessing the database, executing backend functions, managing data, and more. To learn more about what the Client SDK has to offer, view the documentation on managing database data, documentation on AI agents and workflows, documentation on Squid storage bucket integrations, and the documentation on calling an API.

Explore