Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

app-store-server-deno

A Deno-first, TypeScript module scaffolding inspired by Apple's App Store Server Library (Node/Java/Swift). It uses Deno's fetch and WebCrypto via jose for JWT/JWS.

Install / Use

import { AppStoreServerAPIClient, createAuthToken } from "./mod.ts"; // or a URL import once published

Auth Token

const env = {
  issuerId: "<ISSUER_ID_UUID>",
  keyId: "<KEY_ID>",
  bundleId: "com.example.app",
  privateKey: Deno.readTextFileSync("./AuthKey_XXXXXX.p8"),
  endpoint: "sandbox" as const,
};

const token = await createAuthToken(env);
console.log(token.token);

Client

const client = new AppStoreServerAPIClient(env);
const history = await client.getTransactionHistory("<transactionId>");
console.log(history);

Notes

  • Apple requires the JWT's exp - iat to be ≤ 20 minutes; the helper clamps to 10 minutes by default.
  • The client auto-caches the JWT and refreshes ~1 minute before expiry.
  • Extend client.ts with more endpoints as needed.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages