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

strapi-plugin-unirate

v0.1.0

Published

Strapi v5 plugin for the UniRate currency-exchange API — server-side proxy routes (rate/convert/currencies/vat) and an injectable UniRate service. Zero runtime deps.

Readme

strapi-plugin-unirate

Strapi v5 plugin that integrates the UniRate API for currency exchange rates and VAT data. Registers four content-API routes and an injectable unirate service — your API key stays server-side, never exposed to clients.

Install

npm install strapi-plugin-unirate

Configuration

Set your API key as an environment variable:

UNIRATE_API_KEY=your_key_here

Or pass it via Strapi plugin config in config/plugins.ts:

export default {
  unirate: {
    enabled: true,
    config: {
      apiKey: process.env.UNIRATE_API_KEY,
      // baseUrl: 'https://api.unirateapi.com',  // default
      // timeoutMs: 30000,                        // default
    },
  },
};

Routes

The plugin registers these content-API routes (prefix: /api/unirate):

| Method | Path | Description | |--------|------|-------------| | GET | /api/unirate/rate?base=USD&target=EUR | Exchange rate (single or all) | | GET | /api/unirate/convert?from=USD&to=EUR&amount=100 | Convert amount | | GET | /api/unirate/currencies | List supported currencies | | GET | /api/unirate/vat?country=DE | VAT rates (optional country filter) |

Routes have no Strapi auth by default — add Strapi API token restrictions in the admin panel as needed.

Service usage

Access the service in lifecycle hooks, custom controllers, or middleware:

// In a Strapi lifecycle hook or custom controller
const unirate = strapi.plugin('unirate').service('unirate');

// Get a single rate
const rate = await unirate.getRate('USD', 'EUR');   // → 0.92

// Get all rates for a base
const rates = await unirate.getRate('USD');          // → { EUR: 0.92, GBP: 0.79, ... }

// Convert an amount
const result = await unirate.convert('EUR', 100, 'USD');  // → 92.00

// List supported currencies
const currencies = await unirate.listCurrencies();   // → ['USD', 'EUR', 'GBP', ...]

// VAT rates
const vat = await unirate.getVatRates();             // all countries
const de  = await unirate.getVatRates('DE');         // single country

Error handling

All errors extend UniRateError:

import { UniRateError, AuthenticationError, RateLimitError, ProRequiredError } from 'strapi-plugin-unirate';

try {
  const rate = await unirate.getRate('USD', 'EUR');
} catch (err) {
  if (err instanceof AuthenticationError) { /* invalid key */ }
  if (err instanceof RateLimitError)      { /* slow down */   }
  if (err instanceof ProRequiredError)    { /* upgrade plan */}
}

Free vs Pro tier

Free-tier endpoints: rates, convert, currencies, VAT rates. Historical data and time series require a Pro subscription.

Related packages

UniRate API client libraries: Python · Node.js · Go · Rust · Ruby · PHP · Java · Swift · .NET

Framework integrations: Next.js · Nuxt · SvelteKit · Astro · NestJS · Eleventy · React · Vue · tRPC · Strapi (this package)

CMS & e-commerce: WordPress · Directus · Medusa · Hugo · Jekyll

Data & AI: LangChain Python · FastAPI · Flask · Django REST · dbt · Airflow

Other: MCP server · CLI · Obsidian · money gem · laravel-money

License

MIT © Unirate Team