magunga-ai
v1.0.1
Published
JavaScript SDK for the Magunga AI API — ExFreight email intelligence
Downloads
334
Readme
Magunga AI — JavaScript SDK JavaScript SDK for the Magunga AI API. Works in Node.js 18+ and modern browsers. Install bashnpm install github:Jake-exfreight/magunga-ai#main --prefix ./sdk/javascript Or copy index.js directly into your project. Usage — Node.js javascriptimport { MagungaAI } from 'magunga-ai'
const client = new MagungaAI('your_api_key_here')
// Search by reference number const results = await client.search('CITIFL-1646342009') for (const thread of results.results) { console.log(thread.subject) console.log(thread.summary) console.log(thread.thread_link) }
// Download a single email await client.downloadEmail( results.results[0].emails[0].message_id, results.results[0].emails[0].mailbox, 'email.eml' )
// Download full thread as zip await client.downloadThread( results.results[0].thread_id, 'thread.zip' )
// Get permanent Outlook link const link = await client.getLink(results.results[0].emails[0].message_id) console.log(link) Usage — Browser html import { MagungaAI } from './index.js'
const client = new MagungaAI('your_api_key_here') const results = await client.search('CITIFL-1646342009') console.log(results)
// Triggers automatic file download in browser await client.downloadEmail( results.results[0].emails[0].message_id, results.results[0].emails[0].mailbox ) API keys Contact [email protected] to get an API key.
