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

luqta-admin-sdk

v1.0.0

Published

Luqta Web SDK - Official JavaScript/TypeScript SDK for Luqta API integration

Readme

Luqta Web SDK

Official JavaScript/TypeScript SDK for integrating Luqta contest and quiz management into any web application.

Installation

npm install luqta-web-sdk

Or via CDN:

<script src="https://unpkg.com/luqta-web-sdk/dist/luqta-sdk.min.js"></script>

Quick Start

Preconfigured Mode (Built-in UI)

Drop a ready-made screen directly into your page — no UI work needed.

<div id="luqta-container" style="height: 100vh;"></div>
import { LuqtaClient } from 'luqta-web-sdk';

const client = new LuqtaClient({
  mode: 'preconfigured',
  apiKey: 'YOUR_API_KEY',
  screen: 'dashboard',
  containerId: 'luqta-container',
});

await client.render();

Custom Mode (API Only)

Use the SDK as a pure API client and build your own UI.

import { LuqtaClient } from 'luqta-web-sdk';

const client = new LuqtaClient({
  mode: 'custom',
  apiKey: 'YOUR_API_KEY',
});

await client.initialize();

const contests = await client.contests.getAll();
const quizzes  = await client.quiz.getAll();

Available Screens

| Screen | Description | |---|---| | dashboard | Overview stats and analytics | | contests | List and manage contests | | contest-detail | Single contest details | | create-contest | Create a new contest | | create-quiz | Create a new quiz | | participants | View and filter participants | | subusers | Manage sub-users | | billing | Billing history and reports | | subscription | Subscription plan details | | notifications | Notification center |


Configuration

new LuqtaClient({
  apiKey: string;           // Required — your Luqta API key
  mode?: 'preconfigured' | 'custom';  // Default: 'preconfigured'
  screen?: ScreenType;      // Which screen to render
  containerId?: string;     // ID of the container element (default: 'luqta-container')
  locale?: 'en' | 'ar';    // Language (default: 'en')
  rtl?: boolean;            // Right-to-left layout (default: false)
  branding?: BrandingConfig;
  onAction?: (action) => void;
  onError?: (error) => void;
})

Branding

Customize colors, fonts, and logo to match your brand:

const client = new LuqtaClient({
  mode: 'preconfigured',
  apiKey: 'YOUR_API_KEY',
  screen: 'dashboard',
  branding: {
    primaryColor: '#5304fb',
    secondaryColor: '#8f67fd',
    textColor: '#1E005E',
    fontFamily: 'Inter, sans-serif',
    logoUrl: 'https://yoursite.com/logo.png',
    appName: 'My App',
    borderRadius: 16,
  },
});

Arabic / RTL

const client = new LuqtaClient({
  mode: 'preconfigured',
  apiKey: 'YOUR_API_KEY',
  screen: 'dashboard',
  locale: 'ar',
  rtl: true,
});

API Modules (Custom Mode)

Contests

await client.contests.getAll();
await client.contests.create(contestData);
await client.contests.update(contestData);
await client.contests.delete(contestId);

Quizzes

await client.quiz.getAll();
await client.quiz.create(quizData);
await client.quiz.update(quizData);

Participants

await client.participants.getAll({ page: 1 });

Sub-users

await client.subusers.getAll();
await client.subusers.create({ name, email, password });
await client.subusers.delete(userId);

Billing

await client.billing.getReport({ page: 1 });

Subscription

await client.subscription.getDetail();

Notifications

await client.notifications.getAll();

Analytics

await client.analytics.getContestStats();
await client.analytics.getGenderStats();
await client.analytics.getAgeGroupStats();
await client.analytics.getCountryStats();
await client.analytics.getDailyAnalytics();

Error Handling

try {
  await client.render();
} catch (err) {
  if (err.name === 'LuqtaError') {
    console.log(err.code);    // e.g. 'INVALID_API_KEY'
    console.log(err.message); // Human-readable message
  }
}

Common error codes:

| Code | Description | |---|---| | MISSING_API_KEY | No API key provided | | INIT_FAILED | Initialization request failed | | INVALID_API_KEY | API key is invalid or expired | | CONTAINER_NOT_FOUND | Container element not found in DOM | | NO_TOKEN | Server did not return an auth token |


CDN Usage

<div id="luqta-container" style="height: 600px;"></div>

<script src="https://unpkg.com/luqta-web-sdk/dist/luqta-sdk.min.js"></script>
<script>
  const client = new LuqtaSDK.LuqtaClient({
    mode: 'preconfigured',
    apiKey: 'YOUR_API_KEY',
    screen: 'dashboard',
    containerId: 'luqta-container',
  });
  client.render();
</script>

Other Methods

client.setBranding({ primaryColor: '#ff0000' });
client.setLocale('ar', true);          // locale, rtl
client.configure({ screen: 'billing' });
client.destroy();                       // cleanup & remove from DOM

License

MIT