import Morphik from 'morphik';
const client = new Morphik({
apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
});
const response = await client.ingest.batchIngestFiles({
files: [fs.createReadStream('path/to/file')],
});
console.log(response.documents);
Each file is treated the same as :func:ingest_file but sharing the same
request avoids many round-trips. All heavy work is still delegated to the
background worker pool.
POST
/
ingest
/
files
JavaScript
Copy
Ask AI
import Morphik from 'morphik';
const client = new Morphik({
apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
});
const response = await client.ingest.batchIngestFiles({
files: [fs.createReadStream('path/to/file')],
});
console.log(response.documents);