To keep a small footprint in your application, the Trust Stack SDK is split into modules. Each module is a separate package and can be imported individually.
This means you can install only what is important to your application.
npm install @truststack/canvas
# or
yarn add @truststack/canvas
# or
pnpm add @truststack/canvas
npm install @truststack/canvas
# or
yarn add @truststack/canvas
# or
pnpm add @truststack/canvas
npm install @truststack/admin
# or
yarn add @truststack/admin
# or
pnpm add @truststack/admin
npm install @truststack/hermes
# or
yarn add @truststack/hermes
# or
pnpm add @truststack/hermes
npm install @truststack/did
# or
yarn add @truststack/did
# or
pnpm add @truststack/did
Configuration
If you call configure
on any module, it will set those attributes for all modules.
import { AdminClient } from '@truststack/admin';
AdminClient.configure({ accessKey: 'my-access-key' });
...
import { CanvasClient } from '@truststack/canvas';
// This will use the access key set above
const client = new CanvasClient();
client.createCanvasTemplate({ ... });