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

@jokio/capacitor-purchases

v0.1.1

Published

IAP Purchases integration for iOS and Android

Readme

capacitor-purchases

IAP Purchases integration for iOS and Android

Install

npm install capacitor-purchases
npx cap sync

API

echo(...)

echo(options: { value: string; }) => Promise<{ value: string; }>

A test method which just returns what is passed in

| Param | Type | | ------------- | ------------------------------- | | options | { value: string; } |

Returns: Promise<{ value: string; }>


getProductDetails(...)

getProductDetails(options: { productIdentifier: string; }) => Promise<ProductDetailsResponse>

Receives a product ID and returns the product details

| Param | Type | | ------------- | ------------------------------------------- | | options | { productIdentifier: string; } |

Returns: Promise<ProductDetailsResponse>


purchaseProduct(...)

purchaseProduct(options: { productIdentifier: string; userId?: string; }) => Promise<PurchaseProductResponse>

Receives the product ID which the user wants to purchase and returns the transaction ID

| Param | Type | | ------------- | ------------------------------------------------------------ | | options | { productIdentifier: string; userId?: string; } |

Returns: Promise<PurchaseProductResponse>


getCurrentEntitlements()

getCurrentEntitlements() => Promise<CurrentEntitlementsResponse>

Returns: Promise<CurrentEntitlementsResponse>


getLatestTransaction(...)

getLatestTransaction(options: { productIdentifier: string; }) => Promise<LatestTransactionResponse>

| Param | Type | | ------------- | ------------------------------------------- | | options | { productIdentifier: string; } |

Returns: Promise<LatestTransactionResponse>


manageSubscriptions()

manageSubscriptions() => any

Returns: any


setGoogleVerificationDetails(...)

setGoogleVerificationDetails(options: { googleVerifyEndpoint: string; bid: string; }) => void

| Param | Type | | ------------- | ----------------------------------------------------------- | | options | { googleVerifyEndpoint: string; bid: string; } |


addListener('ANDROID-PURCHASE-RESPONSE', ...)

addListener(eventName: 'ANDROID-PURCHASE-RESPONSE', listenerFunc: (response: AndroidPurchasedTrigger) => void) => Promise<PluginListenerHandle>

| Param | Type | | ------------------ | -------------------------------------------------------------------------------------------------- | | eventName | 'ANDROID-PURCHASE-RESPONSE' | | listenerFunc | (response: AndroidPurchasedTrigger) => void |

Returns: Promise<PluginListenerHandle>


restorePurchases()

restorePurchases() => Promise<RestorePurchasesResponse>

Returns: Promise<RestorePurchasesResponse>


Interfaces

ProductDetailsResponse

| Prop | Type | | --------------------- | --------------------------------------------------------------------------------------- | | responseCode | ProductDetailsResponseCode | | responseMessage | ProductDetailsResponseMessage | | data | Product |

Product

| Prop | Type | | ----------------------- | ------------------- | | productIdentifier | string | | price | string | | displayName | string | | description | string |

PurchaseProductResponse

| Prop | Type | | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | responseCode | 0 | 1 | 2 | 5 | 4 | 3 | -1 | | responseMessage | 'Incompatible with web' | 'Could not find a product matching the given productIdentifier' | 'Successfully purchased product' | 'Product seems to have been purchased but the transaction failed verification' | 'User closed the native popover before purchasing' | 'Product request made but is currently pending - likely due to parental restrictions' | 'An unknown error occurred whilst in the purchasing process' | 'Successfully opened native popover' | 'Failed to open native popover' |

CurrentEntitlementsResponse

| Prop | Type | | --------------------- | ------------------------------------------------------------------------------------------------- | | responseCode | CurrentEntitlementsResponseCode | | responseMessage | CurrentEntitlementsResponseMessage | | data | Transaction[] |

Transaction

| Prop | Type | | ----------------------- | -------------------- | | productIdentifier | string | | expiryDate | string | | originalId | string | | transactionId | string | | originalStartDate | string | | isTrial | boolean | | purchaseToken | string |

LatestTransactionResponse

| Prop | Type | | --------------------- | --------------------------------------------------------------------------------------------- | | responseCode | LatestTransactionResponseCode | | responseMessage | LatestTransactionResponseMessage | | data | Transaction |

PluginListenerHandle

| Prop | Type | | ------------ | ----------------------------------------- | | remove | () => Promise<void> |

AndroidPurchasedTrigger

| Prop | Type | | ----------- | -------------------- | | fired | boolean |

RestorePurchasesResponse

| Prop | Type | | --------------- | -------------------- | | completed | boolean |

Type Aliases

ProductDetailsResponseCode

-1 | 0 | 1

ProductDetailsResponseMessage

'Incompatible with web' | 'Successfully found the product details for given productIdentifier' | 'Could not find a product matching the given productIdentifier'

PurchaseProductIOSResponseCode

-1 | 0 | 1 | 2 | 3 | 4 | 5

PurchaseProductAndroidResponseCode

-1 | 0 | 1

PurchaseProductIOSResponseMessage

'Incompatible with web' | 'Successfully purchased product' | 'Could not find a product matching the given productIdentifier' | 'Product seems to have been purchased but the transaction failed verification' | 'User closed the native popover before purchasing' | 'Product request made but is currently pending - likely due to parental restrictions' | 'An unknown error occurred whilst in the purchasing process'

PurchaseProductAndroidResponseMessage

'Incompatible with web' | 'Successfully opened native popover' | 'Failed to open native popover'

CurrentEntitlementsResponseCode

-1 | 0 | 1 | 2

CurrentEntitlementsResponseMessage

'Incompatible with web' | 'Successfully found all entitlements across all product types' | 'No entitlements were found' | 'Unknown problem trying to retrieve entitlements'

LatestTransactionResponseCode

-1 | 0 | 1 | 2 | 3

LatestTransactionResponseMessage

'Incompatible with web' | 'Successfully found the latest transaction matching given productIdentifier' | 'Could not find a product matching the given productIdentifier' | 'No transaction for given productIdentifier, or it could not be verified' | 'Unknown problem trying to retrieve latest transaction'