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:
- Fetch data from multiple data sources (including joins).
- Modify data with transaction support.
- Utilize Squid's built-in NoSQL database to store and retrieve data.
It also connects you to your API integrations so you can:
Additionally, the Client SDK works in partnership with the Squid Backend SDK to:
- Execute backend functions.
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.
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
:
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
Calling your API integration
By integrating your APIs with Squid, you can take advantage of highly configurable security in the backend and intuitive functionality with the Squid Client SDK
Distributed lock management
Manage access to your shared resources in real-time to transact data in the desired order
🤫 Secrets
With secrets, Squid provides state of the art support for managing sensitive data like API keys, passwords, certificates and more. While most secret management can be done in the Squid Console, the Squid Client SDK also provides a secrets API that allows for programmatic management.
Storage
Learn how to securely manage uploads and downloads of files with Squid Storage.
Squid AI
Squid AI works with your data to provide domain-specific insights that you and your users need.