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

@starvale-sdk/authqris

v1.0.4

Published

Node.js SDK for OrderKuota authentication and session management

Readme

@starvale-sdk/authqris

Node.js SDK untuk OrderKuota authentication dan session management.

Dibuat oleh AltharDev untuk StarVale.

Fitur

  • Login ke OrderKuota dengan username dan password
  • OTP verification flow
  • Penyimpanan sesi yang fleksibel:
    • MemorySessionStore untuk penyimpanan in-memory
    • SessionManager untuk penyimpanan file JSON
    • dukungan custom session store melalui options.sessionManager
  • Konfigurasi OrderKuotaClient dapat di-overwrite
  • Ringan dan dapat digunakan di bot, web, atau aplikasi console

Instalasi

npm install @starvale-sdk/authqris

Penggunaan

Import SDK

Untuk CommonJS:

const { OrderKuotaSdk, MemorySessionStore } = require('@starvale-sdk/authqris');

Untuk ESM / Next.js / Turbopack:

import pkg from '@starvale-sdk/authqris';
const { OrderKuotaSdk, MemorySessionStore } = pkg;

Jika setup bundler kamu masih mengeluarkan error OrderKuotaSdk is not a constructor, gunakan default import seperti ini:

import pkg from '@starvale-sdk/authqris';
const { OrderKuotaSdk, MemorySessionStore } = pkg;

OrderKuotaSdk mendukung interoperabilitas CommonJS/ESM dengan module.exports.__esModule = true dan default export pada paket.

Login dan OTP (in-memory session)

const sdk = new OrderKuotaSdk({
  sessionManager: new MemorySessionStore(),
});

async function main() {
  const loginResult = await sdk.login('default', 'username', 'password');

  if (!loginResult.success) {
    console.error('Login failed:', loginResult);
    return;
  }

  if (loginResult.results?.otp === 'email') {
    console.log('OTP dikirim, lanjutkan dengan:', loginResult.results.otp_value);
    const otpResult = await sdk.verifyOtp('default', '123456');
    console.log('OTP result:', otpResult);
  }

  console.log('Token:', sdk.getToken('default'));
}

main();

Menggunakan custom session store

class DatabaseSessionStore {
  async load() { ... }
  async save(sessions) { ... }
  async get(sessionId) { ... }
  async set(sessionId, data) { ... }
  async delete(sessionId) { ... }
}

const sdk = new OrderKuotaSdk({
  sessionManager: new DatabaseSessionStore(),
});

Catatan: kelas OrderKuotaSdk mendukung sessionManager custom, jadi kamu bisa menggunakan database apapun sebagai storage.

API

new OrderKuotaSdk(options)

  • options.orderKuotaClientOptions - override API base URL, path, user agent, atau device config
  • options.sessionsFile - path file JSON untuk SessionManager
  • options.sessionManager - custom session manager object
  • options.errorLogger - fungsi logging error

sdk.login(sessionId, username, password)

Melakukan login dan menyimpan status sesi.

sdk.verifyOtp(sessionId, otpCode)

Memverifikasi OTP dan menyimpan token setelah sukses.

sdk.getSession(sessionId)

Mengambil data sesi.

sdk.getToken(sessionId)

Mengambil token bila sesi sudah logged_in.

sdk.resetSession(sessionId)

Menghapus sesi.

Lisensi

MIT