Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.omneo.io/llms.txt

Use this file to discover all available pages before exploring further.

The Omneo Barcode service generates barcode images that can be embedded anywhere an <img> tag is accepted — emails, web pages, digital wallet passes, and more. Barcodes are authenticated via HMAC to prevent unauthorised generation.

How it works

  1. Decide on your barcode parameters (data, type, dimensions, colours)
  2. Generate an HMAC-256 token from your parameters using your Omneo barcode secret
  3. Set the barcode service URL as the src of an <img> tag
<img src="https://omneo-barcode-v5r64nnrcq-ts.a.run.app/barcode?data=13924318823&type=code128&padding=0&color=black&bgColor=white&hriFontSize=3&hriMarginTop=1&token=YOUR_TOKEN"/>

Authentication

Get your barcode secret from your Omneo administrator. The secret is tenant-specific. Generate the HMAC-256 token from your parameters string (everything except &token=...):
Parameters: data=13924318823&padding=0&color=black&bgColor=white&type=code128&hriFontSize=3&hriMarginTop=1&hriFontFamily=Geneva
Secret: 1234
Token: 13628a9b6c8e9e0eb39cf63f5876477dc66fa688622010a6e10c9f2cba4f3f6e
The token is only valid for the exact set of parameters used to generate it. Changing any parameter invalidates the token.

Barcode types

TypeCharacter restrictions
code128Full ASCII
code39Alphanumeric + -. $/+%
ean1312 numerical digits
ean87 numerical digits
datamatrixNo restrictions (2D)
upc11 numerical digits
qrFull Unicode (2D)

Key parameters

ParameterDescriptionDefault
dataValue to encodeRequired
typeBarcode type (see above)Required
tokenHMAC-256 authentication tokenRequired
colorBar colour (hex or named)black
bgColorBackground colourwhite
paddingPadding in pixels (all sides)0
widthImage width in pixels150
heightImage height in pixels150
barWidthBar width in pixels (1D only)1
barHeightBar height in pixels (1D only)50
hriShowShow human-readable text below barcodetrue
hriFontFamilyFont for human-readable textGeneva
hriFontSizeFont size for human-readable text
hriMarginTopMargin between barcode and HRI text0

Common use case: Loyalty card barcode in email

Generate a barcode with the customer’s loyalty card number for inclusion in a welcome email:
const crypto = require('crypto')

function generateBarcodeUrl(loyaltyCardNumber, secret) {
  const params = `data=${loyaltyCardNumber}&type=code128&padding=4&color=black&bgColor=white&hriShow=true&hriFontSize=3&hriMarginTop=2`
  const token = crypto.createHmac('sha256', secret).update(params).digest('hex')
  return `https://omneo-barcode-v5r64nnrcq-ts.a.run.app/barcode?${params}&token=${token}`
}