appstoreconnect
Unofficial REST API client for Apple's App Store Connect API
Installation
appstoreconnect
has been tested to work on Node.js 8.0+. Use with any prior version is unsupported.
npm install appstoreconnect
Usage
// Import the API version from the package, which mirror Apple's API versioning // Read .p8 private key from disk or from environment, and supply the issuer ID and key identifier as outlined here:// https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requestsconst privateKey = '' // replace with the contents of your private keyconst issuerId = '' // replace with your issuer IDconst keyId = '' // replace with your key ID const token = v1 // Initialize the service. Passing the token up-front is optional, but should be done before any API calls are made.const api = // Compare to https://developer.apple.com/documentation/appstoreconnectapi/list_buildsv1 testflight
All asynchronous functionality in appstoreconnect
is driven using native Promises.
Authentication
The App Store Connect API requires a JSON Web Token (JWT) for all API requests. appstoreconnect
presents both synchronous and asynchronous interfaces for processing the token. You should feel free to use the one that fits best into your project. Both interfaces can surface errors, so use a try-catch where appropriate.
const token = v1
{ try const token = await v1 catch error throw error }
For more information on how JWT works with the App Store Connect API, check out Apple's authentication guides:
Examples
This is an ongoing work-in-progress so I don't have many examples yet. If you have an idea for an example, please feel free to file an issue or a pull request!
API Reference
A proper API reference for appstoreconnect
is coming soon, but in the meantime, much of the documentation is lifted from Apple's reference notes on the App Store Connect API here.
License
This code is licensed under the MIT License.
TODO
- Fully stub App Store Connect API
- Confirm basic functionality
- Confirm complex edge cases (complex queries, mutating calls, non-JSON responses, etc.)
- Determine work involved in stubbing a v2 API and compatibility between different components
- Testing
- Write end-to-end tests to confirm interface and design
- Write unit tests for individual, internal components
- Run tests on CI
- Improve documentation
- Add more examples
- Improve code comments around API surface
- Update README
- Produce API reference site when new tags are pushed