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

@nailyjs.nest.modules/app-store

v1.0.5

Published

Nestjs Apple App Store Module

Downloads

5

Readme

Apple App Store Server SDK for Nest.js 🍎

Introduction 📖

This is a Nest.js SDK for Apple App Store Server API. It is based on apple-app-store-api.

It is a Nest.js module that can be easily integrated into Nest.js projects.

Install 📦

npmyarnpnpm are all supported. Recommend pnpm.

pnpm add @nailyjs.nest.modules/app-store @apple/app-store-server-library

Usage 📚

Basic Usage 💼

import { Module } from "@nestjs/common";
import { AppleAppStoreModule } from "@nailyjs.nest.modules/app-store";

@Module({
  imports: [
    AppleAppStoreModule.register({
      // If true, the module can be used across all modules.
      global: true,
      clients: {
        provide: APP_STORE_SERVER_API_CLIENT,
        signingKey: "",
        issuerId: "",
        bundleId: "",
        keyId: "",
        environment: Environment.SANDBOX,
      },
    }),
  ],
})
export class AppModule {}

In your service, you can directly inject the AppStoreServerAPIClient instance.

import { Injectable } from "@nestjs/common";
import { AppStoreServerAPIClient } from "@apple/app-store-server-library";

@Injectable()
export class AppStoreService {
  constructor(private readonly appStoreServerAPIClient: AppStoreServerAPIClient) {}

  // ...
}

AppStoreServerAPIClient is imported from official package @apple/app-store-server-library.

Async Usage 🚀

import { Module } from "@nestjs/common";
import { AppleAppStoreModule } from "@nailyjs.nest.modules/app-store";
import { Environment } from "@apple/app-store-server-library";

@Module({
  imports: [
    AppleAppStoreModule.registerAsync({
      // If true, the module can be used across all modules.
      global: true,
      clients: {
        inject: [],
        useFactory: () => {
          return {
            signingKey: "",
            issuerId: "",
            bundleId: "",
            keyId: "",
            environment: Environment.SANDBOX,
          };
        },
      },
    }),
  ],
})
export class AppModule {}

Multiple Clients 🔗

Also can use multiple async clients. The following example shows how to use multiple general clients.

import { Module } from "@nestjs/common";
import { AppleAppStoreModule } from "@nailyjs.nest.modules/app-store";
import { Environment } from "@apple/app-store-server-library";

export const APP_STORE_SERVER_API_CLIENT_ONE = Symbol("APP_STORE_SERVER_API_CLIENT_ONE");
export const APP_STORE_SERVER_API_CLIENT_TWO = Symbol("APP_STORE_SERVER_API_CLIENT_TWO");

@Module({
  imports: [
    AppleAppStoreModule.register({
      // If true, the module can be used across all modules.
      global: true,
      clients: [
        {
          provide: APP_STORE_SERVER_API_CLIENT_ONE,
          signingKey: "",
          issuerId: "",
          bundleId: "",
          keyId: "",
          environment: Environment.SANDBOX,
        },
        {
          provide: APP_STORE_SERVER_API_CLIENT_TWO,
          signingKey: "",
          issuerId: "",
          bundleId: "",
          keyId: "",
          environment: Environment.PRODUCTION,
        },
      ],
    }),
  ],
})
export class AppModule {}

In your service, you can inject the exported APP_STORE_SERVER_API_CLIENT_ONE or APP_STORE_SERVER_API_CLIENT_TWO symbol.

import { Injectable } from "@nestjs/common";
import { AppStoreServerAPIClient } from "@apple/app-store-server-library";
import { APP_STORE_SERVER_API_CLIENT_ONE } from "./app.module";

@Injectable()
export class AppStoreService {
  constructor(
    @Inject(APP_STORE_SERVER_API_CLIENT_ONE)
    private readonly appStoreServerAPIClientOne: AppStoreServerAPIClient,
    @Inject(APP_STORE_SERVER_API_CLIENT_TWO)
    private readonly appStoreServerAPIClientTwo: AppStoreServerAPIClient,
  ) {}

  // ...
}

Author 👨‍💻

Zero

Donate ☕️

If you find this project useful, you can buy author a glass of coffee 🥰

wechat alipay