Query features with Chalk's TypeScript client library
The Chalk TypeScript client library provides a convenient way to query features from your TypeScript and JavaScript applications.
Install the Chalk TypeScript client using npm or yarn:
npm install @chalk-ai/clientor
yarn add @chalk-ai/clientHere’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);