import { Client } from 'cyborgdb';
const client = new Client({ baseUrl: 'http://localhost:8000', apiKey: 'your-api-key' });
// Generate a secure encryption key
const indexKey = client.generateKey();
console.log('Generated key length:', indexKey.length); // Output: 32
const index = await client.createIndex({
indexName: 'my-secure-index',
indexKey
});
// IMPORTANT: Store the key securely for future access
// const keyHex = Buffer.from(indexKey).toString('hex');
// console.log('Store this key safely:', keyHex);