Skip to content
Taprel
Docs menu Quick start

Quick start

From nothing to a printed receipt in about five minutes, in JavaScript, React or Vue.

You need a Windows PC with a printer that already prints from Windows, and a web app built with a bundler, such as Vite.

1Install the app

Download the Taprel app (the file ending in _x64-setup.exe) and run it on the PC with the printer. It needs no admin rights, and after a short guide it runs in the tray, next to the clock.

In the app, open Printers and check that your receipt printer’s type is Receipt.

2Add the package

npm install @taprel/sdk

@taprel/react and @taprel/vue include @taprel/sdk, so everything in it can be imported from them too.

3Set it up

// src/printer.ts: import it wherever you print.
import { PrintClient } from "@taprel/sdk";

export const printer = new PrintClient();

This connects nothing yet, so opening a page never asks anything. The first print connects.

import { receipt } from "@taprel/sdk";
import { printer } from "./printer";

await printer.printDocument(
  receipt([
    { text: "Café Central", align: "center", bold: true, size: 2 },
    { text: "12 rue de la Paix, Paris", align: "center" },
    { line: "dashed" },
    { row: ["2 x Coffee", "6.00"] },
    { row: ["1 x Croissant", "2.50"] },
    { line: "dashed" },
    { row: ["Total", "8.50"], bold: true, size: 2 },
    { text: "Thank you!", align: "center" },
    { cut: true },
  ]),
);

It goes to the printer set as Receipt, so it needs no printer name.

The receipt it prints: Café Central in large bold letters, its address, a dashed line, 2 x Coffee 6.00 and 1 x Croissant 2.50, another dashed line, Total 8.50 in large bold letters, and Thank you!

5Allow it once

The first time, the app asks Allow this website to print? Click Allow, and the receipt comes out.

On your own computer this is free, with no account, up to 50 print jobs a day. Nothing came out? See Troubleshooting.

Next steps

  • Receipts Rows, pictures, QR codes and barcodes.
  • Labels Text and barcodes at exact positions.
  • Printers Pick a printer, and check its status.
  • Going live Your customers’ PCs, and a plan for your website.