@chassdev/client-sdk
v2.46.2
Published
Typed Core, Metadata and REST API clients for Chass applications.
Readme
Typed API clients for applications that extend Chass: a Core client for workspace records, a Metadata client for the data model, and a REST client.
Installation
Apps import this package as twenty-client-sdk, so install it under that name, on the same version as twenty-sdk:
yarn add -D twenty-client-sdk@npm:@chassdev/client-sdk twenty-sdk@npm:@chassdev/sdkProjects scaffolded with create-chass-app already include it.
Usage
import { CoreApiClient } from 'twenty-client-sdk/core';
const client = new CoreApiClient();
const { companies } = await client.query({
companies: { edges: { node: { id: true, name: true } } },
});| Entry point | Contents |
| ---------------------------- | ------------------------------------------------------------- |
| twenty-client-sdk/core | CoreApiClient, typed from your workspace schema |
| twenty-client-sdk/metadata | MetadataApiClient for objects, fields, and other metadata |
| twenty-client-sdk/rest | RestApiClient for the REST API |
| twenty-client-sdk/generate | Client generation helpers used by the chass CLI |
yarn chass dev regenerates the Core client from your workspace schema whenever the data model changes, so its types follow your objects and fields.
Documentation
See the Chass apps documentation for logic functions, front components, and the CLI.
License
The Chass Client SDK is released under the MIT license. The full text ships in the package's LICENSE file.
