import Casedev from 'casedev';
const client = new Casedev({ apiKey: 'sk_case_YOUR_API_KEY' });
// Using file upload
const pdf = await client.superdoc.v1.convert({
file: documentFile,
from: 'docx',
to: 'pdf'
});
// Using base64
const docx = await client.superdoc.v1.convert({
document_base64: Buffer.from(markdownContent).toString('base64'),
from: 'md',
to: 'docx'
});
// Using URL
const result = await client.superdoc.v1.convert({
document_url: 'https://example.com/document.docx',
from: 'docx',
to: 'pdf'
});