The Chalk TypeScript client library provides a convenient way to query features from your TypeScript and JavaScript applications.


Installation

Install the Chalk TypeScript client using npm or yarn:

npm install @chalk-ai/client

or

yarn add @chalk-ai/client

Basic Usage

Here’s a quick example of how to use the Chalk TypeScript client:

import { ChalkClient } from '@chalk-ai/client';

// Initialize the client
const client = new ChalkClient({
  clientId: 'your-client-id',
  clientSecret: 'your-client-secret',
  environmentId: 'your-environment-id'
});

// Query features
const result = await client.query({
  inputs: {
    'user.id': 'user123'
  },
  outputs: [
    'user.credit_score',
    'user.account_age_days'
  ]
});

console.log(result);

Next Steps