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

@faqai/sdk

v0.3.0

Published

Official TypeScript/JavaScript SDK for FAQai.app — turn documents into production-ready RAG datasets.

Readme

@faqai/sdk

Official TypeScript/JavaScript client for FAQai.app — turn any document into production-ready RAG datasets (Canonical Q&A, Query Variants, Evaluation, Adversarial, and RAG Chunks) and export to 16 formats including Pinecone, Qdrant, pgvector, Chroma, Weaviate, Milvus, LanceDB, and Upstash.

Large files just work. Uploads above ~4 MB are automatically routed through the FAQai upload proxy, so you never hit the serverless 4.5 MB body limit and never see a 413 — up to your plan's 25 MB maximum, in a single call.

Works in Node 18+, Deno, Bun, Cloudflare Workers, and modern browsers (anywhere with global fetch).

Install

npm install @faqai/sdk

Quickstart

import { FaqaiClient } from "@faqai/sdk";

const client = new FaqaiClient("faq_your_api_key"); // or set FAQAI_API_KEY

// Upload (any size up to your plan limit) and wait for processing
const doc = await client.upload("large-report.pdf", { wait: true });
console.log(doc.status); // "completed"

// List generated datasets
const { datasets } = await client.listDatasets(doc.id);
for (const ds of datasets) console.log(ds.dataset_type, ds.item_count);

// Export a dataset for your vector DB
const content = await client.export(datasets[0].id, "pinecone");

// Search your generated Q&A
const hits = await client.search("refund policy", { datasetType: "canonical_qa" });
console.log(hits.total);

// Coverage report
const cov = await client.coverage(datasets[0].id);
console.log(cov.coverage_percent);

Uploading from bytes or a Blob

// Bytes (filename required)
await client.upload(new Uint8Array(buf), { filename: "doc.pdf" });

// Browser File input
await client.upload(fileFromInput); // File has a name already

Ingesting from a URL or website

No file needed — point FAQai at a public web page, or crawl a whole same-domain site (discovered via its sitemap, or a breadth-first walk if there is none). Crawling honors robots.txt and your plan's per-crawl page cap (Free 5, Basic 50, Starter 150, Pro 500). Only static HTML is read, so JavaScript-rendered pages may yield little content.

// Single page
const doc = await client.ingestUrl("https://example.com/docs/faq", { wait: true });

// Crawl a site (up to 50 same-domain pages), steer generation, and wait
const site = await client.ingestUrl("https://example.com/", {
  crawl: true,
  maxPages: 50,
  generationContext: "customer_support_bot",
  wait: true,
});
console.log(site.crawl); // { discovered, capped_to, estimated_pages, mode }

Configuration

| Option / env var | Default | Purpose | | --------------------------------------------- | ---------------------- | -------------------------------- | | apiKey / FAQAI_API_KEY | — | Your faq_... API key (required) | | baseUrl / FAQAI_BASE_URL | https://faqai.app | API base URL | | uploadProxyUrl / FAQAI_UPLOAD_PROXY_URL | FAQai production proxy | Large-file upload proxy URL | | timeoutMs | 60000 | Per-request timeout | | maxRetries | 3 | Retries for 429/5xx with backoff |

const client = new FaqaiClient({ apiKey: "faq_...", timeoutMs: 120_000 });

Error handling

All failures throw a FaqaiError (or a subclass: AuthenticationError, PermissionError, NotFoundError, PayloadTooLargeError, RateLimitError, TimeoutError). Each carries .status, .code, and .responseBody.

import { FaqaiClient, RateLimitError } from "@faqai/sdk";

try {
  await client.upload("doc.pdf");
} catch (e) {
  if (e instanceof RateLimitError) console.log("Slow down:", e.message);
}

How large-file uploads work

Files ≤ 4 MB are sent directly to POST /api/v1/documents. Larger files are sent to the FAQai upload proxy (a Supabase Edge Function), which performs the 3-step presigned upload flow on your behalf and returns the same document record. It's automatic — no code changes needed.

License

MIT