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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@lwtlab/app-store-receipt-parser

v1.0.0

Published

A lightweight TypeScript library for extracting transaction IDs from Apple's ASN.1 encoded receipts.

Downloads

10

Readme

Apple Receipt Parser

Latest Version on NPM Scrutinizer build Scrutinizer quality Scrutinizer coverage Software License Total Downloads

A lightweight TypeScript library for extracting transaction IDs from Apple's ASN.1 encoded Unified Receipts.

[!IMPORTANT] This library is not a full-fledged receipt parser. It only extracts some information from Apple's ASN.1 encoded Unified Receipts. It does not work with the old-style transaction receipts.

[!NOTE] Documentation for the version 1.x of the library can be found here.

Installation

Using npm:

npm install @lwtlab/app-store-receipt-parser

Using yarn:

yarn add @lwtlab/app-store-receipt-parser

Usage

import { parseReceipt } from '@tamtamchik/app-store-receipt-parser';

// Unified Receipt string 
const receiptString = "MII...";
const data = parseReceipt(receiptString);

console.log(data);
// {
//   ENVIRONMENT: 'ProductionSandbox',
//   APP_VERSION: '1',
//   ORIGINAL_APP_VERSION: '1.0',
//   OPAQUE_VALUE: 'c4dd4054b0b61a07beb585f6a842e048',
//   SHA1_HASH: '2e0a115beac1c57023a5bd37349955a9ad99db4d',
//   BUNDLE_ID: 'com.mbaasy.ios.demo',
//   RECEIPT_CREATION_DATE: '2015-08-13T07:50:46Z',
//   ORIGINAL_PURCHASE_DATE: '2013-08-01T07:00:00Z',
//   IN_APP_EXPIRES_DATE: '2015-08-10T07:19:32Z',
//   IN_APP_CANCELLATION_DATE: '',
//   IN_APP_QUANTITY: '020101',
//   IN_APP_WEB_ORDER_LINE_ITEM_ID: '0207038d7ea69472c9',
//   IN_APP_PRODUCT_ID: 'monthly',
//   IN_APP_TRANSACTION_ID: '1000000166967782',
//   IN_APP_TRANSACTION_IDS: [
//     '1000000166865231',
//     '1000000166965150',
//     '1000000166965327',
//     '1000000166965895',
//     '1000000166967152',
//     '1000000166967484',
//     '1000000166967782'
//   ],
//   IN_APP_ORIGINAL_TRANSACTION_ID: '1000000166965150',
//   IN_APP_ORIGINAL_TRANSACTION_IDS: [
//     '1000000166865231',
//     '1000000166965150'
//   ],
//   IN_APP_PURCHASE_DATE: '2015-08-10T07:14:32Z',
//   IN_APP_ORIGINAL_PURCHASE_DATE: '2015-08-10T07:12:34Z'
// }

Special Thanks

  • @Jurajzovinec for his superb contribution to the project.
  • @fechy for bringing environment variable support to the lib.

Contributing

Pull requests are always welcome. If you have bigger changes, please open an issue first to discuss your ideas.

License

Apple Receipt Parser is MIT licensed.

Third-Party Licenses

This project uses ASN1.js, licensed under the BSD-3-Clause License. The license text can be found in LICENSE.


Buy Me A Coffee