@jeremybarbet/nest-iap
TypeScript icon, indicating that this package has built-in type declarations

1.4.1 • Public • Published

@jeremybarbet/nest-iap

Wrapper around iap library to embed in NestJS applications.

Installation

yarn add @jeremybarbet/nest-iap

Usage

import { IAPModule } from '@jeremybarbet/nest-iap';

@Module({
  controllers: [...],
  providers: [...],
  imports: [
    IAPModule.forRoot({
      apple: {
        password: '',
      },
      google: {
        clientEmail: '',
        privateKey: '',
      },
    }),
  ],
})
import { IAPService } from '@jeremybarbet/nest-iap';

class MyService {
  constructor(private readonly iapService: IAPService) {}

  async someMethod() {
    const { response } = await this.iapService.verifyAppleReceipt({
      transactionReceipt: 'BASE_64_RECEIPT',
    });
  }

  async someOtherMethod() {
    const { response } = await this.iapService.verifyGoogleReceipt({
      packageName: 'PACKAGE_NAME',
      token: 'TOKEN',
      productId: 'PRODUCT_ID',
    });
  }
}

License

This library is licensed under the MIT License.

/@jeremybarbet/nest-iap/

    Package Sidebar

    Install

    npm i @jeremybarbet/nest-iap

    Weekly Downloads

    420

    Version

    1.4.1

    License

    MIT

    Unpacked Size

    9.87 kB

    Total Files

    11

    Last publish

    Collaborators

    • jeremy.barbet