Official Browser SDK for 100PrintsWithMe.
Render 100PrintsWithMe templates as PNG, JPEG, raster PDF, or vector PDF directly in a modern browser.
Create templates visually in the 100PrintsWithMe Dashboard, connect them with dynamic data, and render certificates, ID cards, event badges, invoices, reports, tickets, product graphics, and other print-ready documents without building your own rendering engine.
No backend rendering is required for browser-based generation.
https://playground.100printswith.me
Create templates and browser-safe publishable keys at:
The v2 API handles template loading, dynamic field replacement, fonts, rendering, downloads, and object URL cleanup behind one small class.
- Browser-side PNG, JPEG, raster PDF, and vector PDF rendering
- Front and back template support
- Typed TypeScript API with autocomplete-friendly inputs
- Dynamic template data replacement
- Direct rendering into an
<img>element - Built-in download helpers
- Blob and object URL results for browser previews
- Deterministic platform and custom font loading
- Automatic font fallback handling
- ESM package and standalone UMD/browser bundle
- npm and
<script>/ CDN usage - Framework agnostic
- No backend renderer required for browser-side generation
- Legacy
BrowserSDKcompatibility for existing v1 integrations
The SDK can be used anywhere you need to turn structured data into a reusable visual template.
Generate personalized course, event, participation, achievement, or training certificates.
const certificate = await prints.pdf({
templateId: "tpl_certificate",
data: {
Name: "Rishabh Dev",
Course: "Advanced Mathematics",
Date: "October 7, 2026"
},
includeBack: false
});
certificate.download("certificate.pdf");Render the front or back of an ID card independently.
const card = await prints.png({
templateId: "tpl_id_card",
data: {
Name: "Rishabh Dev",
EmployeeID: "EMP-1042",
Department: "Engineering"
},
side: "front"
});
document.querySelector<HTMLImageElement>("#card")!.src = card.url;Generate badges from event registration data.
const badge = await prints.png({
templateId: "tpl_badge",
data: {
Name: "Maya Lin",
Company: "Example Labs",
Role: "Speaker"
},
side: "front"
});Create personalized academic reports from student data.
const report = await prints.pdf({
templateId: "tpl_report",
data: {
StudentName: "Maya Lin",
Grade: "11",
Mathematics: 98,
Physics: 95,
Chemistry: 96
},
includeBack: true
});Merge customer, order, payment, and company information into reusable document templates.
Generate event tickets, visitor passes, QR-enabled passes, coupons, and admission documents.
Use templates to generate dynamic graphics directly inside a website or web application.
Useful for:
- e-commerce product banners
- sale and discount cards
- personalized recommendation graphics
- product promotion images
- marketplace seller creatives
- dynamic catalog visuals
- social sharing graphics
- price-drop graphics
- customer-specific banners
Example:
const banner = await prints.png({
templateId: "tpl_product_banner",
data: {
ProductName: "Running Shoes",
Price: "₹2,499",
Discount: "30% OFF",
ProductImage: "https://example.com/shoe.png"
},
side: "front",
quality: "high"
});
document.querySelector<HTMLImageElement>("#offer-banner")!.src = banner.url;This makes it possible to update a visual using live application data without manually rebuilding the graphic.
Generate documents or graphics that users can preview and download immediately inside a browser application.
Reuse the same template with many rows of data to create batches of personalized documents.
npm install @100printswithme/browser-sdkpnpm add @100printswithme/browser-sdkyarn add @100printswithme/browser-sdkThe SDK runs in the browser and requires Canvas, Fetch, Blob, and object URL support.
import { HundredPrints } from "@100printswithme/browser-sdk";
const prints = new HundredPrints({
publishableKey: "pk_live_xxx"
});
const image = await prints.png({
templateId: "tpl_123",
data: {
Name: "Rishabh Dev",
Role: "Chief Scientist"
},
side: "front",
quality: "high"
});
document.querySelector<HTMLImageElement>("#preview")!.src = image.url;Keys in data must match the dynamic fields configured in the template.
Use a browser-safe publishable key. Never expose a secret backend key in client-side code.
image.url is a local object URL. It works for browser previews and downloads, but it is not a permanent public URL.
Call:
image.revoke();after the page no longer needs it.
const prints = new HundredPrints({
publishableKey: "pk_live_xxx"
});Create your templates and publishable keys from:
Create the client once and reuse it so template and font caches remain effective.
Images render exactly one template side.
side is required and accepts:
"front" | "back"Example:
const png = await prints.png({
templateId: "tpl_123",
data: {
Name: "Rishabh Dev"
},
side: "front",
quality: "high"
});
const jpeg = await prints.jpeg({
templateId: "tpl_123",
data: {
Name: "Rishabh Dev"
},
side: "back",
quality: "standard"
});
png.download("front.png");
jpeg.download("back.jpg");Image results provide:
format
blob
url
width
height
side
download()
revoke()
PDF output renders the front by default.
Set:
includeBack: trueto add the back as a second page when the template contains one.
const pdf = await prints.pdf({
templateId: "tpl_123",
data: {
Name: "Rishabh Dev"
},
includeBack: true,
quality: "ultra"
});
pdf.download("document.pdf");For selectable text and supported vector artwork, use the vector PDF renderer:
const pdf = await prints.vectorPdf({
templateId: "tpl_123",
data: {
Name: "Rishabh Dev"
},
includeBack: true
});
pdf.download("print-ready.pdf");PDF results provide:
format
blob
url
pages
download()
revoke()
render() accepts a discriminated output object.
TypeScript requires side for image outputs and exposes includeBack for PDF outputs.
const result = await prints.render({
templateId: "tpl_123",
data: {
Name: "Rishabh Dev"
},
output: {
format: "png",
side: "front",
quality: "high"
}
});const result = await prints.render({
templateId: "tpl_123",
data: {
Name: "Rishabh Dev"
},
output: {
format: "pdf",
includeBack: true,
quality: "high"
}
});Supported formats:
png
jpeg
pdf
vector-pdf
renderTo() accepts a CSS selector or an HTMLImageElement.
It supports PNG and JPEG output.
<img id="preview" alt="Rendered template">const result = await prints.renderTo("#preview", {
templateId: "tpl_123",
data: {
Name: "Rishabh Dev"
},
output: {
format: "png",
side: "front",
quality: "high"
}
});The returned result can still be used:
result.download("preview.png");When the image is no longer needed:
result.revoke();Use download() when you only need the generated file.
await prints.download({
templateId: "tpl_123",
data: {
Name: "Rishabh Dev"
},
output: {
format: "pdf",
includeBack: true,
quality: "high"
},
filename: "document.pdf"
});The helper cleans up its temporary object URL after starting the download.
| Quality | Intended use |
|---|---|
draft |
Fast previews |
standard |
Normal screen output |
high |
High-resolution output |
ultra |
Maximum-resolution print output |
The browser/UMD build exposes:
window.HundredPrintsso the SDK can be used without npm or a bundler.
<script src="https://cdn.jsdelivr.net/npm/@100printswithme/browser-sdk@2.0.0/dist/100prints-sdk.umd.js"></script>Example:
<img id="preview" alt="Rendered template">
<script src="https://cdn.jsdelivr.net/npm/@100printswithme/browser-sdk@2.0.0/dist/100prints-sdk.umd.js"></script>
<script>
const prints = new HundredPrints({
publishableKey: "pk_live_xxx"
});
prints.renderTo("#preview", {
templateId: "tpl_123",
data: {
Name: "Rishabh Dev"
},
output: {
format: "png",
side: "front",
quality: "high"
}
}).catch(console.error);
</script>You can also use unpkg:
<script src="https://unpkg.com/@100printswithme/browser-sdk@2.0.0/dist/100prints-sdk.umd.js"></script>For production applications, prefer a version-pinned CDN URL.
Serve integrations over HTTP or HTTPS. Opening the page through file:// prevents reliable API and font requests.
The SDK resolves fonts before drawing.
Resolution order:
- Explicit template or custom font URL
- 100PrintsWithMe platform font library
- Google Fonts for families outside the platform library
- Inter, the platform default
- Browser
sans-serif
Known platform fonts use absolute 100PrintsWithMe asset URLs so the SDK works when embedded on another origin.
Recoverable platform or Google font failures emit a warning and continue using an available fallback.
Explicit custom font URLs retain their configured behavior and can raise:
FONT_LOAD_FAILED
when the custom font itself cannot be loaded.
SDK failures reject with HundredPrintsError.
Each error contains:
code
message
cause
where available.
import {
HundredPrints,
HundredPrintsError
} from "@100printswithme/browser-sdk";
try {
await prints.png({
templateId: "tpl_123",
data: {},
side: "front"
});
} catch (error) {
if (error instanceof HundredPrintsError) {
console.error(
error.code,
error.message,
error.cause
);
}
}Error codes can include:
AUTH_INVALID
TEMPLATE_NOT_FOUND
INVALID_INPUT
UNSUPPORTED_FORMAT
UNSUPPORTED_SIDE
INVALID_TARGET
FONT_LOAD_FAILED
RENDER_FAILED
DOWNLOAD_FAILED
Version 2 introduces HundredPrints as the recommended public API.
key
→ publishableKey
payload
→ data
PNG / JPEG
→ explicit side
PDF
→ includeBack
render result
→ blob + url + download() + revoke()
Example v2:
import { HundredPrints } from "@100printswithme/browser-sdk";
const prints = new HundredPrints({
publishableKey: "pk_live_xxx"
});The original BrowserSDK remains available for existing integrations:
import { BrowserSDK } from "@100printswithme/browser-sdk";
const sdk = new BrowserSDK({
key: "pk_live_xxx"
});
const { blob } = await sdk.render({
templateId: "tpl_123",
payload: {
Name: "Rishabh Dev"
},
format: "pdf"
});New integrations should use HundredPrints.
The package targets ES2020 and current versions of:
- Chrome
- Edge
- Firefox
- Safari
Rendering requires a browser DOM and is not intended for Node.js server-side rendering.
In frameworks with server-side rendering, import and call the SDK from client-side code.
Low-level Canvas or PDF libraries usually require developers to manually build document layouts in code.
100PrintsWithMe uses a different workflow:
design template visually
↓
get template ID
↓
pass application data
↓
render
Your application only needs to provide dynamic values.
No manual PDF positioning.
No Canvas layout code.
No custom rendering engine setup.
The same template can be reused across thousands of renders with different data.
npm install
npm test
npm run buildThe script-tag example is available at:
examples/script-tag/index.html
After building:
npm run devthen open:
http://localhost:5173/examples/script-tag/
- Website: https://100printswith.me
- SDK Playground: https://playground.100printswith.me
- npm: https://www.npmjs.com/package/@100printswithme/browser-sdk
- Documentation: https://100printswith.me/docs
MIT © 2026 100PrintsWithMe.