TypeScript SDK
TypeScript SDK
Das offizielle TypeScript/JavaScript SDK für die Laddro Career API.
Installieren
npm install @laddro/career-sdkSchnellstart
import { Laddro } from '@laddro/career-sdk'
const client = new Laddro({
apiKey: process.env.LADDRO_API_KEY!
})
// Vorlagen auflisten (öffentlich, keine Authentifizierung nötig)
const templates = await client.templates.list()
// Lebenslauf parsen
const resume = await client.resumes.parse(
new File([buffer], 'resume.pdf', { type: 'application/pdf' })
)
// Für eine Stelle anpassen
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
})Vorlagen
// Alle Vorlagen auflisten
const templates = await client.templates.list()
// Bestimmte Vorlage abrufen
const template = await client.templates.get('graphite')Lebensläufe
// Lebensläufe auflisten
const resumes = await client.resumes.list()
// Lebenslauf abrufen
const resume = await client.resumes.get('res_abc123')
// Aus Datei parsen
const parsed = await client.resumes.parse(file)
// Als PDF rendern
const pdf = await client.resumes.render('res_abc123', {
templateId: 'graphite'
})Anpassung
// Standard-Anfrage
const result = await client.tailor.create({
resumeId: 'res_abc123',
positionName: 'Senior Engineer',
jobDescription: 'We are looking for...'
})
// Streaming
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)
}Anschreiben
// Mit Streaming generieren
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)
}
// Als PDF rendern
const pdf = await client.coverLetters.render('cl_abc123', {
templateId: 'graphite'
})Export
import { writeFileSync } from 'fs'
const pdf = await client.export({
resumeId: 'res_abc123',
templateId: 'graphite'
})
writeFileSync('resume.pdf', Buffer.from(pdf))Einstellungen (BYOK)
// Aktuelles Modell abrufen
const settings = await client.settings.get()
// Benutzerdefiniertes Modell festlegen
await client.settings.setModel({
provider: 'anthropic',
model: 'claude-haiku-4.5',
apiKey: 'sk-ant-...'
})
// Auf Standard zurücksetzen
await client.settings.resetModel()Fehlerbehandlung
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"
}
}