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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@explorins/pers-sdk

v1.6.28

Published

Platform-agnostic SDK for PERS (Phygital Experience Rewards System) - Core business logic and API integration

Readme

@explorins/pers-sdk

npm version License: MIT

Platform-agnostic TypeScript SDK for PERS (Phygital Experience Rewards System) - Modern Manager-Service architecture providing clean, consistent APIs for tourism loyalty applications.

Overview

PERS is a comprehensive tourism loyalty platform bridging physical and digital experiences through loyalty programs, campaign management, payments, blockchain integration, business management, and analytics.

Installation

npm install @explorins/pers-sdk

Quick Start

import { PersSDK } from '@explorins/pers-sdk';
import { BrowserFetchClientAdapter } from '@explorins/pers-sdk/platform-adapters';

const sdk = new PersSDK(new BrowserFetchClientAdapter(), {
  environment: 'production',
  apiProjectKey: 'your-project-key'
});

// Authentication
const user = await sdk.auth.getCurrentUser();

// Business operations
const businesses = await sdk.businesses.getActiveBusinesses();

// Campaign management
const campaigns = await sdk.campaigns.getActiveCampaigns();
const campaignClaim = await sdk.campaigns.claimCampaign({ campaignId: 'campaign-123', userId: 'user-456' });

// Token operations
const tokens = await sdk.tokens.getTokens();
const balances = await sdk.tokens.getBalances(userId);

Platform Integration

Angular

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { PersSDK } from '@explorins/pers-sdk';
import { AngularHttpClientAdapter } from '@explorins/pers-sdk/platform-adapters';

@Injectable({ providedIn: 'root' })
export class PersSDKService {
  private sdk: PersSDK;

  constructor(httpClient: HttpClient) {
    this.sdk = new PersSDK(new AngularHttpClientAdapter(httpClient), {
      environment: 'production',
      apiProjectKey: 'your-project-key'
    });
  }

  getSDK(): PersSDK {
    return this.sdk;
  }
}

React/Browser

import { PersSDK } from '@explorins/pers-sdk';
import { BrowserFetchClientAdapter } from '@explorins/pers-sdk/platform-adapters';

const sdk = new PersSDK(new BrowserFetchClientAdapter(), {
  environment: 'production',
  apiProjectKey: 'your-project-key'
});

Node.js

import { PersSDK } from '@explorins/pers-sdk';
import { NodeHttpClientAdapter } from '@explorins/pers-sdk/platform-adapters';

const sdk = new PersSDK(new NodeHttpClientAdapter(), {
  environment: 'production',
  apiProjectKey: 'your-project-key'
});

Architecture

The SDK uses a clean Manager-Service pattern:

// Manager Layer (Primary Interface)
sdk.auth           // Authentication & sessions
sdk.users          // User profiles & management
sdk.tokens         // Token operations & balances
sdk.businesses     // Business operations
sdk.campaigns      // Marketing campaigns
sdk.redemptions    // Reward redemptions
sdk.transactions   // Transaction history
sdk.payments       // Payment processing
sdk.analytics      // Reporting & insights
sdk.tenants        // Multi-tenant configuration
sdk.donations      // Charitable giving
sdk.files          // File operations
sdk.web3           // Blockchain operations

// Service Layer (Advanced Access)
sdk.users.getUserService()     // Direct service access
sdk.campaigns.getCampaignService()

Core Features

Authentication

  • External JWT integration (Firebase, Auth0, etc.)
  • Native token validation and refresh
  • User and admin authentication flows

Business Management

  • Business registration and profiles
  • Business type management
  • Public business discovery

Campaign System

  • Marketing campaign management
  • User campaign claims and participation
  • Advanced campaign triggers and automation

Token Economy

  • Token balance management
  • Token transfers and transactions
  • Multiple token type support

Reward Redemptions

  • Redemption offer management
  • User redemption tracking
  • Multiple redemption types

Payment Processing

  • Payment intent creation
  • Purchase token management
  • Transaction history

Configuration

interface PersConfig {
  environment?: 'development' | 'staging' | 'production';
  apiVersion?: 'v2';
  apiProjectKey: string;
  timeout?: number;
  retries?: number;
  authProvider?: PersAuthProvider;
}

Error Handling

import { PersApiError } from '@explorins/pers-sdk/core';

try {
  const user = await sdk.auth.getCurrentUser();
} catch (error) {
  if (error instanceof PersApiError) {
    console.error('PERS API Error:', error.message, error.statusCode);
  }
}

Bundle Size

  • Core SDK: ~85 KB (minified)
  • Tree-shaking friendly
  • Zero external authentication dependencies
  • Native browser API implementation

Documentation

For comprehensive documentation, examples, and advanced usage:

https://docs.pers.ninja/1.intro

For detailed API reference:

https://docs.pers.ninja/sdk (Interactive API Documentation)

Related Packages

License

MIT License