Try our new Claude Code Skill to automatically integrate Hyperspell into your project
import Hyperspell from 'hyperspell';
const client = new Hyperspell({
apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
});
const memoryStatus = await client.memories.upload({ file: fs.createReadStream('path/to/file') });
console.log(memoryStatus.resource_id);{
"source": "collections",
"resource_id": "<string>",
"status": "pending"
}This endpoint will upload a file to the index and return a resource_id.
The file will be processed in the background and the memory will be available for querying once the processing is complete.
You can use the resource_id to query the memory later, and check the status of the memory.
import Hyperspell from 'hyperspell';
const client = new Hyperspell({
apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
});
const memoryStatus = await client.memories.upload({ file: fs.createReadStream('path/to/file') });
console.log(memoryStatus.resource_id);{
"source": "collections",
"resource_id": "<string>",
"status": "pending"
}API Key or JWT User Token. If using an API Key, set the X-As-User header to act as a specific user. A JWT User Token is always scoped to a specific user.
Was this page helpful?