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

@bradford-tech/asc-sdk

v0.1.2

Published

TypeScript SDK for the Apple App Store Connect API

Downloads

523

Readme

@bradford-tech/asc-sdk

Auto-generated TypeScript SDK for Apple's App Store Connect API -- 1055 tree-shakeable operations, with date-time fields converted to native Date objects.

Generated against App Store Connect API spec 4.3.1.

Install

npm install @bradford-tech/asc-sdk

Also available on jsr:

deno add jsr:@bradford-tech/asc-sdk   # Deno
npx jsr add @bradford-tech/asc-sdk    # npm via jsr

Usage

The SDK exports flat functions for every API operation and a client singleton for configuration. Auth is a callback that returns a JWT string -- pair it with @bradford-tech/asc-auth or bring your own.

import { client, appsGetCollection } from "@bradford-tech/asc-sdk";
import { createASCAuth } from "@bradford-tech/asc-auth";

const auth = createASCAuth({
  issuerId: "57246542-96fe-1a63-e053-0824d011072a",
  keyId: "2X9R4HXF34",
  privateKey: process.env.ASC_PRIVATE_KEY!,
});

client.setConfig({ auth });

const { data } = await appsGetCollection();
console.log(data?.data.map((app) => app.attributes?.name));
// => ["My App", "Another App"]

Bring your own auth

If you already have a JWT source, pass it directly:

client.setConfig({
  auth: () => myExistingTokenFunction(),
});

Filtering and including related resources

Operations accept the same query parameters as Apple's REST API:

const { data } = await appsGetCollection({
  query: {
    "filter[bundleId]": ["com.example.myapp"],
    include: ["appStoreVersions"],
  },
});

Features

  • Flat, tree-shakeable exports -- each operation is a standalone function. Import only what you use; bundlers drop the rest.
  • Date transforms -- 261 of 1055 endpoints auto-convert date-time response fields to native Date objects via @hey-api/transformers.
  • Typed request and response -- full TypeScript types generated from Apple's OpenAPI spec, including query parameters, request bodies, and response shapes.
  • Daily spec updates -- a GitHub Actions workflow downloads Apple's latest OpenAPI spec and opens a PR when it changes. The SDK stays current without manual intervention.
  • ESM-only -- "type": "module" with explicit .js extensions for Node.js ESM resolution. No CJS dual-publish overhead.

Date handling

Dates in API responses are automatically converted from ISO 8601 strings to native Date objects for endpoints whose schemas contain date-time fields. This includes fields like createdDate, expirationDate, startDate, and earliestReleaseDate.

Exceptions:

  • included arrays -- dates inside JSON:API included arrays remain as ISO strings. Apple's included uses oneOf unions for polymorphic resources, and the transformer plugin does not process union types.
  • Top-level schemas without dates -- some endpoints' top-level response schemas have no date-time fields. Dates live on related sub-resources accessed via separate relationship endpoints. appsGetCollection, appsGetInstance, and buildsGetCollection are examples. Access dates via the dedicated relationship endpoints (e.g., appsAppStoreVersionsGetToManyRelated) or parse included items manually.

For either case, parse manually:

const createdDate = new Date(includedItem.attributes.createdDate);

int64 fields

Fields marked as int64 in Apple's spec (file sizes, disk metrics, upload offsets) are returned as number, not BigInt. All observed ASC int64 values are well within Number.MAX_SAFE_INTEGER (~9 petabytes for file sizes). If you have a use case requiring BigInt precision, file an issue.

Error handling

Every operation returns { data, error, request, response }. On success, data is populated and error is undefined. On failure, data is undefined and error contains Apple's ErrorResponse body:

const { data, error } = await appsGetCollection();

if (error) {
  // error.errors is Apple's array of { status, code, title, detail }
  console.error(error.errors?.[0]?.detail);
} else {
  console.log(data.data.map((app) => app.attributes?.name));
}

To throw on errors instead of returning them:

client.setConfig({ auth, throwOnError: true });

Configuration

client.setConfig() accepts standard fetch options alongside SDK-specific ones:

client.setConfig({
  auth,
  baseUrl: "https://api.appstoreconnect.apple.com/", // default
  fetch: customFetchImpl, // custom fetch (useful for logging or retries)
  throwOnError: false, // true to throw instead of returning { error }
});

The base URL is set automatically. Override it only if you're routing through a proxy.

Generation

All code in src/client/ is auto-generated by @hey-api/openapi-ts from spec/openapi.oas.json. Do not edit generated files directly -- configure the generator in openapi-ts.config.ts and run:

npm run generate

Contributing

Bug reports and pull requests are welcome on GitHub.

License

MIT