We're excited to announce the official release of the doppio-nodejs package, making it even easier to integrate Doppio's PDF and screenshot generation into your Node.js applications.
Installation
Install the package via npm:
npm install doppio-nodejs
Quick Start
Here's how to generate a PDF in just a few lines of code:
const { Doppio } = require('doppio-nodejs');
const client = new Doppio(process.env.DOPPIO_API_KEY);
const pdf = await client.renderPdfSync({
goto: { url: 'https://your-website.com' },
pdf: { printBackground: true },
});
console.log(pdf.documentUrl);
Features
- Simple, intuitive API that mirrors Doppio's REST endpoints
- Full TypeScript support with type definitions
- Support for all render modes: sync, async, and direct
- Built-in error handling and retries
- Template rendering support
Screenshot Generation
Taking screenshots is just as easy:
const screenshot = await client.renderScreenshotSync({
goto: { url: 'https://your-website.com' },
screenshot: { type: 'png', fullPage: true },
});
console.log(screenshot.documentUrl);
Get Started
Check out the npm package page and the documentation to get started.