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 connectors, authentication, backend functions, and more.

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.

On the Squid backend, the Client SDK is readily available without needing initialization. You can directly access it using this.squid inside an extended SquidService class.

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, region, and environmentId. For local development, also include your squidDeveloperId. These values can be found on the application overview page of the Squid Console:

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

const squid = new Squid({
appId: 'YOUR_APP_ID',
region: 'YOUR_REGION', // example: 'us-east-1.aws'
environmentId: 'dev', // or prod
squidDeveloperId: 'YOUR_SQUID_DEVELOPER_ID',
});

The Squid class serves as the primary entry point for the Squid Client SDK, offering a comprehensive array of functionality for accessing all of Squid's features.

To learn more about what the Client SDK has to offer, view the documentation on managing database data, AI agents and workflows, Squid storage bucket connectors, and API connectors.

Don't see the feature you are looking for? Reach out to us for help with your project!