TypeScript SDK
TypeScript SDK
Den officielle TypeScript/JavaScript SDK til Laddro Career API.
Installer
npm install @laddro/career-sdkHurtig start
import { Laddro } from '@laddro/career-sdk'
const client = new Laddro({
apiKey: process.env.LADDRO_API_KEY!
})
// List skabeloner (offentlig, ingen godkendelse krævet)
const templates = await client.templates.list()
// Parse et CV
const resume = await client.resumes.parse(
new File([buffer], 'resume.pdf', { type: 'application/pdf' })
)
// Tilpas til et job
const result = await client.tailor.create({
resumeId: resume.id,
positionName: 'Senior Frontend Engineer',
jobDescription: 'We are looking for...'
})Konfiguration
const client = new Laddro({
apiKey: 'YOUR_API_KEY',
baseUrl: 'https://api.laddro.com', // standard
timeout: 30_000 // 30s standard
})Skabeloner
const templates = await client.templates.list()
const template = await client.templates.get('graphite')CV'er
const resumes = await client.resumes.list()
const resume = await client.resumes.get('res_abc123')
const parsed = await client.resumes.parse(file)
const pdf = await client.resumes.render('res_abc123', { templateId: 'graphite' })Tilpasning
const result = await client.tailor.create({
resumeId: 'res_abc123',
positionName: 'Senior Engineer',
jobDescription: 'We are looking for...'
})
const stream = client.tailor.stream({
resumeId: 'res_abc123',
positionName: 'Senior Engineer',
jobDescription: '...'
})
for await (const event of stream) {
console.log(event.type, event.section, event.content)
}Følgebreve
const stream = client.coverLetters.generate({
resumeId: 'res_abc123',
positionName: 'Senior Engineer',
jobDescription: '...',
stream: true
})
for await (const event of stream) {
process.stdout.write(event.content)
}
const pdf = await client.coverLetters.render('cl_abc123', { templateId: 'graphite' })Eksporter
import { writeFileSync } from 'fs'
const pdf = await client.export({ resumeId: 'res_abc123', templateId: 'graphite' })
writeFileSync('resume.pdf', Buffer.from(pdf))Indstillinger (BYOK)
const settings = await client.settings.get()
await client.settings.setModel({ provider: 'anthropic', model: 'claude-haiku-4.5', apiKey: 'sk-ant-...' })
await client.settings.resetModel()Fejlhåndtering
import { LaddroError } from '@laddro/career-sdk'
try {
await client.resumes.get('nonexistent')
} catch (error) {
if (error instanceof LaddroError) {
console.log(error.status) // 404
console.log(error.message) // "Resume not found"
}
}