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

nativ-sdk

v0.1.4

Published

Node.js/TypeScript SDK for the Nativ AI localization platform

Readme

Nativ Node.js/TypeScript SDK

The official Node.js client for the Nativ AI localization platform.

Wraps the full Nativ REST API with TypeScript types, zero runtime dependencies (uses native fetch), and ESM + CommonJS dual output.

Installation

npm install nativ-sdk

Quick start

import { Nativ } from "nativ-sdk";

const client = new Nativ({ apiKey: "nativ_..." }); // or set NATIV_API_KEY env var

// Translate text
const result = await client.translate("Launch your product globally", "French");
console.log(result.translatedText); // "Lancez votre produit à l'international"
console.log(result.tmMatch);        // TM match details (score, source, etc.)

// Batch translate
const results = await client.translateBatch(
  ["Sign up", "Log in", "Settings"],
  "German",
);
for (const r of results) {
  console.log(r.translatedText);
}

Features

Translation

const result = await client.translate(
  "Welcome to our platform",
  "Spanish",
  {
    context: "SaaS onboarding email subject line",
    formality: "formal",
    backtranslate: true,
  },
);

console.log(result.translatedText);  // translated text
console.log(result.backtranslation); // back-translation for QA
console.log(result.rationale);       // AI explanation of translation choices
console.log(result.tmMatch?.score);  // TM match percentage

OCR — extract text from images

const result = await client.extractText("screenshot.png");
console.log(result.extractedText);

Image culturalization

const result = await client.culturalizeImage(
  "banner_en.png",
  "Soldes d'été",
  "fr",
  { numImages: 3 },
);
for (const img of result.images) {
  // img.imageBase64 contains the generated image
}

Cultural sensitivity inspection

const result = await client.inspectImage("ad_creative.jpg");
console.log(result.verdict); // "SAFE" or "NOT SAFE"
for (const issue of result.affectedCountries) {
  console.log(`${issue.country}: ${issue.issue} → ${issue.suggestion}`);
}

Translation memory

// Search
const matches = await client.searchTm("Sign up", {
  targetLanguageCode: "fr",
});
for (const m of matches) {
  console.log(`${m.score}% — ${m.sourceText} → ${m.targetText}`);
}

// Add entry
await client.addTmEntry(
  "Sign up",
  "S'inscrire",
  "en",
  "fr-FR",
  { name: "onboarding CTA" },
);

// List & filter
const entries = await client.listTmEntries({
  targetLanguageCode: "fr-FR",
  enabledOnly: true,
});
console.log(`${entries.total} entries`);

// Stats
const stats = await client.getTmStats();
console.log(`${stats.total} total, ${stats.enabled} enabled`);

Languages

const languages = await client.getLanguages();
for (const lang of languages) {
  console.log(`${lang.language} (${lang.languageCode}) — formality: ${lang.formality}`);
}

Style guides & brand voice

// List style guides
const guides = await client.getStyleGuides();
for (const g of guides) {
  console.log(`${g.title} — ${g.isEnabled ? "enabled" : "disabled"}`);
}

// Get brand voice prompt
const voice = await client.getBrandVoice();
console.log(voice.prompt);

// Create a style guide
await client.createStyleGuide(
  "Tone of Voice",
  "Always use active voice. Avoid jargon.",
);

Error handling

import { Nativ, InsufficientCreditsError, AuthenticationError } from "nativ-sdk";

const client = new Nativ();

try {
  const result = await client.translate("Hello", "French");
} catch (e) {
  if (e instanceof AuthenticationError) {
    console.log("Bad API key");
  } else if (e instanceof InsufficientCreditsError) {
    console.log("Top up at dashboard.usenativ.com");
  }
}

All exceptions extend NativError and carry statusCode and body properties.

| Exception | HTTP | When | |----------------------------|------|-------------------------------| | AuthenticationError | 401 | Invalid or missing API key | | InsufficientCreditsError | 402 | Not enough credits | | ValidationError | 400 | Bad request parameters | | NotFoundError | 404 | Resource not found | | RateLimitError | 429 | Too many requests | | ServerError | 5xx | Nativ API server error |

Configuration

const client = new Nativ({
  apiKey: "nativ_...",            // or NATIV_API_KEY env var
  baseUrl: "https://...",        // or NATIV_API_URL env var (default: api.usenativ.com)
  timeout: 120_000,              // request timeout in ms (default: 2 minutes)
});

Requirements

  • Node.js 18+ (uses native fetch)
  • Zero runtime dependencies

Related packages

License

MIT