npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

unitag-api-client

v1.0.0

Published

A comprehensive TypeScript/JavaScript client library for the Unitag API v2, providing QR code generation, management, analytics, and more

Readme

Unitag API Client Library

A comprehensive, fully-typed TypeScript/JavaScript client library for the Unitag API v2. Generate, manage, and analyze QR codes with ease.

npm version License: MIT

Features

  • Full TypeScript support with comprehensive type definitions
  • Complete API coverage: QR codes, domains, campaigns, filters, and analytics
  • Modern async/await syntax
  • Custom error handling with specific error types
  • Works in Node.js and browsers
  • Zero dependencies (except dev dependencies)
  • Comprehensive test suite with Vitest
  • Helper utilities for common tasks
  • Production and sandbox environments

Installation

npm install unitag-api-client
yarn add unitag-api-client
pnpm add unitag-api-client

Quick Start

import { UnitagApi } from "unitag-api-client";

// Initialize the client
const api = new UnitagApi({
  apiKey: "your-api-key",
  sandbox: true, // Use sandbox for testing
});

// Create a QR code
const qrCode = await api.createQRCode({
  data: {
    type: "URL",
    resolution: "dynamic",
    url: "https://example.com",
    label: "My Website",
  },
});

console.log("QR Code created:", qrCode.short_url);

Getting Your API Key

Documentation

📚 Full Documentation - Comprehensive guides, API reference, and examples

Quick Links

Basic Usage

Create a QR Code

const qrCode = await api.createQRCode({
  data: {
    type: "URL",
    resolution: "dynamic",
    url: "https://example.com",
    label: "Example",
  },
  settings: {
    layout: {
      type: "gradient",
      gradient_type: "vertical",
      color_one: "#FF0000",
      color_two: "#0000FF",
    },
  },
});

Get All QR Codes

const result = await api.getQRCodes({
  maxRows: 10,
  page: 1,
  sortField: "creation_date",
  sortOrder: "desc",
});

console.log(`Total: ${result.total_records}`);

Download QR Code

const blob = await api.downloadQRCode({
  asset_uuid: "qrcode-uuid",
  format: "png",
  size: 500,
});

Get Analytics

const analytics = await api.getAnalytics({
  time_range: {
    type: 1,
    number: 7,
    unit: "days",
  },
});

console.log(`Visits: ${analytics.visits_count}`);

Error Handling

import {
  UnitagValidationError,
  UnitagRateLimitError,
  isUnitagError
} from 'unitag-api-client';

try {
  const qrCode = await api.createQRCode({...});
} catch (error) {
  if (error instanceof UnitagValidationError) {
    console.error('Validation failed:', error.details);
  } else if (error instanceof UnitagRateLimitError) {
    console.error('Rate limit exceeded. Retry after:', error.retryAfter);
  } else if (isUnitagError(error)) {
    console.error('Unitag API error:', error.message);
  } else {
    console.error('Unexpected error:', error);
  }
}

See the Error Handling Guide for comprehensive error handling patterns.

TypeScript Support

Full TypeScript support with comprehensive type definitions:

import {
  UnitagApi,
  CreateQRCodeRequest,
  QRCodeData,
  Campaign,
  AnalyticsResponse
} from 'unitag-api-client';

const api = new UnitagApi({ apiKey: 'your-key' });
const qrCode: QRCodeData = await api.createQRCode({...});

Development

# Install dependencies
npm install

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

# Build the library
npm run build

# Type checking
npm run typecheck

# Lint
npm run lint

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT

Links

Support

For issues related to this library, please open an issue.

For Unitag API support, contact Unitag through your console dashboard.