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

@mobtechi/sdk-core

v1.1.2

Published

Framework-agnostic core logic and API client for the MobTechi platform

Readme

@mobtechi/sdk-core

The official, framework-agnostic core logic and API client for the MobTechi platform. This library provides a robust foundation for interacting with MobTechi services, including authentication, subscriptions, analytics, and ads.

Installation

npm install @mobtechi/sdk-core

or

yarn add @mobtechi/sdk-core

Getting Started

The SDK exposes a MobTechi class that automatically wires up the underlying API client, analytics tracker, and entitlement engine.

import { MobTechi, MemoryStorageProvider } from '@mobtechi/sdk-core';

const mobtechi = new MobTechi({
    baseUrl: 'https://api.mobtechi.com', // Replace with your environment URL
    appId: 'your-app-id',
    orgId: 'your-org-id', // Optional
    storage: new MemoryStorageProvider(), // Replace with localStorage/AsyncStorage provider for persistence
    tokenKey: 'mobtechi_auth_token'
});

// Access components
const apiClient = mobtechi.api;
const entitlements = mobtechi.entitlements;
const analytics = mobtechi.analytics;

Core Features & Modules

1. Authentication

Handles user identity, login, OTP verification, and token management automatically. Token is seamlessly injected into subsequent API calls.

// 1. Identify User
await mobtechi.api.identify({ identifier: '[email protected]', app_id: '...', org_id: '...' });

// 2. Login (Send OTP or Password)
await mobtechi.login({ identifier: '[email protected]', app_id: '...', org_id: '...' });

// 3. Verify OTP (Automatically sets the access token upon success)
await mobtechi.verifyOtp({ identifier: '[email protected]', code: '123456', app_id: '...', org_id: '...' });

// 4. Logout (Clears local token and resets entitlements)
await mobtechi.logout();

2. Entitlements & Subscriptions

Manage user access to premium features based on their active subscription.

// Sync entitlements from the server
const payload = await mobtechi.syncEntitlements('your-app-id');

// Check feature access synchronously after syncing
if (mobtechi.entitlements.hasFeature('premium_analytics')) {
    // Grant access
}

// Check premium status
const isPremium = mobtechi.entitlements.isPremiumUser();

Direct API methods for subscriptions are available on the api client:

  • api.getPlans()
  • api.getSubscriptionStatus()
  • api.getEntitlements()
  • api.createOrder()
  • api.createSubscription()
  • api.createTopUp()

3. Ads Config

Fetch user-specific or app-specific ad configurations and claim rewards.

// Get Ad configs
const adsConfig = await mobtechi.api.getAdsConfig('your-org-id', 'your-app-key');

// Claim rewards
await mobtechi.api.claimReward({ orgId: '...', appKey: '...', rewardType: '...' });

Advanced Usage

Custom Storage Provider

By default, @mobtechi/sdk-core uses a MemoryStorageProvider which loses tokens upon app restart or page refresh. To persist sessions (e.g., in React Native or web), implement the StorageProvider interface:

import { StorageProvider } from '@mobtechi/sdk-core';

class LocalStorageProvider implements StorageProvider {
    async getItem(key: string): Promise<string | null> {
        return localStorage.getItem(key);
    }
    async setItem(key: string, value: string): Promise<void> {
        localStorage.setItem(key, value);
    }
    async removeItem(key: string): Promise<void> {
        localStorage.removeItem(key);
    }
}

// Use it during initialization
const mobtechi = new MobTechi({
    baseUrl: 'https://api.mobtechi.com',
    appId: 'your-app-id',
    storage: new LocalStorageProvider(),
});

Generic API Requests

The api object provides generic HTTP methods (get, post, put, patch, delete) that automatically attach the authorization token and required app/org headers.

const response = await mobtechi.api.get('/custom/endpoint');
console.log(response.data);

License

MIT