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

@bilmarkltd/license-sdk

v1.0.0

Published

Bilmark License Manager - Offline License Validation SDK

Downloads

30

Readme

Bilmark License SDK

Bilmark License Manager için offline lisans doğrulama SDK'sı.

Kurulum

npm install @bilmarkltd/license-sdk

Hızlı Başlangıç

1. Hardware ID Alma

Lisans oluştururken hardware binding kullanmak istiyorsanız, önce sunucunun hardware ID'sini alın:

import { getHardwareId } from '@bilmarkltd/license-sdk';

const hardwareId = await getHardwareId();
console.log('Hardware ID:', hardwareId);
// Bu ID'yi lisans oluştururken License Manager'a gönderin

2. Lisans Doğrulama

import { LicenseValidator } from '@bilmarkltd/license-sdk';

const validator = new LicenseValidator();

// Dosyadan doğrulama
const result = await validator.validateFile('./license.lic');

if (result.valid) {
  console.log('Lisans geçerli!');
  console.log('Ürün:', result.license.productName);
  console.log('Müşteri:', result.license.customerName);
  console.log('Kalan gün:', result.license.daysRemaining);
} else {
  console.error('Lisans hatası:', result.error);
  process.exit(1);
}

3. Limit Kontrolü

// Kullanıcı sayısı kontrolü
const userCheck = validator.checkLimit(result, 'maxUsers', 45);

if (!userCheck.allowed) {
  console.error(`Kullanıcı limiti aşıldı: ${userCheck.current}/${userCheck.limit}`);
}

// Rapor sayısı kontrolü
const reportCheck = validator.checkLimit(result, 'maxReports', 100);

4. Modül Kontrolü

if (validator.hasModule(result, 'finance')) {
  // Finans modülü aktif
  enableFinanceFeatures();
}

if (validator.hasModule(result, 'hr')) {
  // HR modülü aktif
  enableHRFeatures();
}

Hardware Binding

Lisansı belirli bir sunucuya kilitlemek için:

  1. Sunucuda hardware ID alın
  2. Bu ID'yi License Manager'da lisans oluştururken kullanın
  3. Validator'da hardware binding kontrolünü aktif edin:
const validator = new LicenseValidator({
  checkHardwareBinding: true
});

Public Key Yapılandırması

SDK'yı kullanmadan önce public key'i yapılandırmanız gerekir.

Seçenek 1: Embedded Key (Önerilen)

src/public-key.ts dosyasındaki EMBEDDED_PUBLIC_KEY değerini License Manager'dan alınan public key ile değiştirin.

Seçenek 2: Runtime Key

const validator = new LicenseValidator({
  publicKey: `-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqh...
-----END PUBLIC KEY-----`
});

API Referansı

LicenseValidator

Constructor

new LicenseValidator(options?: ValidatorOptions)

Options:

  • publicKey?: string - Public key (PEM format)
  • checkHardwareBinding?: boolean - Hardware binding kontrolü

Metodlar

  • validateFile(filePath: string): Promise<ValidationResult> - Dosyadan doğrulama
  • validate(content: string): Promise<ValidationResult> - String'den doğrulama
  • checkLimit(result, key, currentValue): LimitCheckResult - Limit kontrolü
  • hasModule(result, moduleCode): boolean - Modül kontrolü

ValidationResult

interface ValidationResult {
  valid: boolean;
  error?: string;
  license?: {
    licenseKey: string;
    productCode: string;
    productName: string;
    customerName: string;
    expiresAt: Date | null;
    limits: Record<string, any>;
    modules: string[];
    daysRemaining: number | null;
    isExpired: boolean;
  };
}

Güvenlik

  • Private key ASLA client uygulamasında bulunmamalıdır
  • Public key embed edilebilir (güvenli)
  • Lisans dosyası manipüle edilirse imza doğrulama başarısız olur