@hautechai/sdk v0.3.21
Hautech SDK
Installation
npm install @hautechai/sdk
# or
yarn add @hautechai/sdkUsage
Creating tokens
To use the SDK, first you need to create a token via token signer.
// THIS CODE SHOULD BE RUN ON SERVER SIDE ONLY!!!
import { createTokenSigner } from '@hautechai/sdk';
const signer = createTokenSigner({
appId: process.env.APP_ID!,
appKeyId: process.env.APP_KEY_ID!,
appKeySecret: process.env.APP_KEY_SECRET!,
});Root token
For creating token that can be used on server side, you can create a root token.
const rootToken = signer.createRootToken({ expiresInSeconds: 3600 });It's very not recommended to use root token on client side.
Account token
For creating token that can be used on client side by your users, you can create an account token.
const accountToken = signer.createAccountToken({ accountId: 'ACCOUNT_ID', expiresInSeconds: 3600 });Initializing SDK
To initialize the SDK, you need to pass the function that returns the token to the createSDK function.
import { createSDK } from '@hautechai/sdk';
const sdk = createSDK({ authToken: () => accountToken }); // you should call the server here for getting the tokenUsing SDK
Docs about how to use the SDK are available here
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago