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

@duabalabs/reviews-sdk

v0.2.0

Published

Framework-agnostic client for the centralized 3y3anaa reviews platform.

Readme

@duabalabs/reviews-sdk

Framework-agnostic client for the centralized 3y3anaa reviews platform — the shared review/rating store for Duabalabs subsidiaries. Reviews target a subject namespaced by (sourceApp, subjectType, externalId); reviewers are external identities (no Parse account needed). Your app authenticates with a per-app key.

Call this server-side — the app key must stay secret.

Install

npm i @duabalabs/reviews-sdk

Usage

import { createReviewsClient } from "@duabalabs/reviews-sdk";

const reviews = createReviewsClient({
  appKey: process.env.THREEYANAA_APP_KEY!, // your per-app key (rk_<app>_…), sent as Bearer
  // baseUrl defaults to https://api.3y3anaa.com — override for self-host/staging
});

// Submit (one review per subject+author; re-submitting edits it)
await reviews.submitReview({
  subjectType: "product",
  externalId: "prod_123",
  subjectDisplayName: "Kente Tote Bag",
  author: { externalUserId: "user_42", displayName: "Ama", role: "buyer" },
  rating: 5,
  body: "Beautiful craftsmanship, fast delivery.",
  verified: true,
});

// Read a subject's reviews + aggregate
const { items, aggregate } = await reviews.getReviews({ subjectType: "product", externalId: "prod_123" });

// Batch aggregates (product grids / cards)
const aggs = await reviews.getAggregates([
  { subjectType: "product", externalId: "prod_123" },
  { subjectType: "product", externalId: "prod_456" },
]);

Proxyfidelity model — artisans, clients & businesses review each other

Reviews are not just buyer→product. The same subjectType + author.role pair models any party reviewing any other. Canonical subjects/roles: artisan, business, client (plus commerce: product, shop, supplier, courier). Any string is accepted, but these are typed for autocomplete.

// A client reviews a business
await reviews.submitReview({
  subjectType: "business", externalId: "biz_001",
  author: { externalUserId: "client_77", displayName: "Kwame", role: "client" },
  rating: 5, body: "Reliable and professional.",
});

// A business reviews an artisan it hired
await reviews.submitReview({
  subjectType: "artisan", externalId: "artisan_9",
  author: { externalUserId: "biz_001", displayName: "Accra Tiles Ltd", role: "business" },
  rating: 4, body: "Great tiling work, slightly late.",
});

// An artisan reviews a client
await reviews.submitReview({
  subjectType: "client", externalId: "client_77",
  author: { externalUserId: "artisan_9", displayName: "Kofi", role: "artisan" },
  rating: 5, body: "Clear brief, paid on time.",
});

Your app reads back its own reviews with getReviews(...). 3y3anaa surfaces the whole network's reviews for a subject — across every integrated app — on that business/artisan's profile (its host getSubjectReviews aggregates them).

Provisioning — give your app credential the subject scopes it needs (empty scopes = all allowed):

provisionAppCredential({ appName: "sellub",
  scopes: ["product","shop","supplier","courier","artisan","business","client"] })

API

  • submitReview(input){ review, aggregate }
  • getReviews({ subjectType, externalId, limit?, skip?, sort? }){ items, total, hasMore, aggregate }
  • getAggregate({ subjectType, externalId }){ avgRating, reviewCount, ratingBreakdown }
  • getAggregates([{subjectType, externalId}, …]) → aggregates[]
  • markHelpful({ reviewId, voterExternalUserId })
  • respondToReview({ reviewId, responderExternalUserId, responderDisplayName?, text })
  • getReviewsByAuthor({ authorExternalUserId, limit?, skip? })

Provisioning an app key

Get your key either self-serve (the 3y3anaa portal → Settings → API Keys) or, for admins, by running the master-key provisionAppCredential cloud function with { appName: "sellub", scopes: ["product","shop","supplier","courier"] }. It returns the plaintext key once — store it in the subsidiary's server env as THREEYANAA_APP_KEY. That single key is all the SDK needs.

Build

npm run build      # tsup → CJS + ESM + .d.ts