npm

Don't miss out on this year's npm Pride t-shirt designs!Order your favorites here »

apple-pricing-matrix

1.0.2 • Public • Published

Programmatic access to Apple's in-app-purchase pricing matrix

Provides lookups for Apple's pricing tiers, accurate as of 2019-01-22

Getting started

$ yarn add apple-pricing-matrix
import {
  getTier,
  getLocaleTier,
  getLocaleCurrency,
  getUSDRate,
} from 'apple-pricing-matrix';
 
const tier1 = getTier('1'); // returns object mapping iso country code to tiering data for tier 1 purchases
 
const tier3Germany = getLocaleTier('3', 'DE'); // returns tier 3 data for Germany
 
const germanCurrency = getLocaleCurrency('DE'); // returns the currency used by Apple for a supported iso country code
 
const dollarRate = getUSDRate('5', 'JP'); // returns the USD conversion rate used by Apple for the given tier and country code

Tests

To run the test suite, first install the dependencies, then run yarn test:

$ yarn
$ yarn test

License

MIT

install

npm i apple-pricing-matrix

Downloadsweekly downloads

636

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability