A Node.js command-line tool for interacting with the App Store Connect API to list apps and in-app purchases.
- π± List all apps in your App Store Connect account
- π List in-app purchases and subscriptions for specific apps
- π° Display en-US prices for all in-app purchases and subscriptions
- π Organize subscriptions by subscription groups
- π Secure authentication using JWT tokens
- βοΈ Flexible configuration via CLI arguments or environment variables
- Node.js 16.0.0 or higher
- npm or yarn
- App Store Connect API key (.p8 file)
- Issuer ID from App Store Connect
git clone <repository-url>
cd appstoreconnect-storekitconfig-node
npm installnpm linkAfter linking, you can use the appstore command from anywhere in your terminal.
- Copy the example environment file:
cp .env.example .env- Edit
.envand add your credentials:
APPSTORE_API_KEY_PATH=/path/to/your/AuthKey_XXXXXXXXXX.p8
APPSTORE_ISSUER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxYou can also provide credentials directly via command-line arguments:
--api-key <path>- Path to your .p8 API key file--issuer-id <id>- Your Issuer ID from App Store Connect--key-id <id>- Your API Key ID (optional if included in the filename)
- Log in to App Store Connect
- Navigate to Users and Access
- Select Keys β App Store Connect API
- Click the + button to create a new key
- Give your key a name and select appropriate permissions
- Download the
.p8file (you can only download it once!) - Note your Issuer ID (displayed at the top of the API Keys page)
- Note your Key ID (displayed in the key list)
Important: Store your .p8 file securely. You cannot download it again after the initial creation.
Using environment variables:
appstore list-appsUsing CLI arguments:
appstore list-apps --api-key /path/to/AuthKey_XXXXXXXXXX.p8 --issuer-id your-issuer-idUsing environment variables:
appstore list-inapp-purchases --app-id YOUR_APP_IDUsing CLI arguments:
appstore list-inapp-purchases --app-id YOUR_APP_ID --api-key /path/to/key.p8 --issuer-id your-issuer-idThis command will:
- Fetch all in-app purchases (consumables, non-consumables) with their US prices
- Fetch all subscription groups and their subscriptions with US prices
- Display items organized by type (in-app purchases first, then subscriptions grouped by subscription group)
appstore --help
appstore list-apps --help
appstore list-inapp-purchases --helpπ± My Awesome App
ID: 123456789
Bundle ID: com.example.myapp
SKU: MYAPP2024
Platform: IOS
π± Another Great App
ID: 987654321
Bundle ID: com.example.another
SKU: ANOTHER2024
Platform: IOS
================================================================================
IN-APP PURCHASES AND SUBSCRIPTIONS
================================================================================
Found 2 in-app purchase(s) and 3 subscription(s)
π¦ IN-APP PURCHASES
--------------------------------------------------------------------------------
π Remove Ads
Product ID: com.example.remove_ads
Type: NON_CONSUMABLE
State: APPROVED
Price (US): $4.99
π 100 Coins Pack
Product ID: com.example.coins_100
Type: CONSUMABLE
State: APPROVED
Price (US): $0.99
π SUBSCRIPTIONS
--------------------------------------------------------------------------------
π Subscription Group: Premium Access
π Premium Monthly
Product ID: com.example.premium_monthly
Period: ONE_MONTH
State: APPROVED
Price (US): $9.99
π Premium Annual
Product ID: com.example.premium_annual
Period: ONE_YEAR
State: APPROVED
Price (US): $79.99
π Premium Weekly Trial
Product ID: com.example.premium_weekly_trial
Period: ONE_WEEK
State: READY_TO_SUBMIT
Price (US): $1.99
================================================================================
To find the App ID needed for the list-inapp-purchases command:
- Run
appstore list-appsto see all your apps - Copy the ID value from the app you want to query
- Use this ID with the
--app-idparameter
Alternatively, you can find the App ID in App Store Connect:
- Go to My Apps
- Select your app
- Go to App Information
- Look for "Apple ID" or check the URL (it contains the app ID)
If you get authentication errors:
- Verify your
.p8file path is correct - Ensure your Issuer ID is correct (find it at the top of the API Keys page in App Store Connect)
- Check that your API key has the necessary permissions
- Ensure the Key ID is correct (either in the filename like
AuthKey_ABC123.p8or provided via--key-id)
If the CLI cannot find your .p8 file:
- Use absolute paths instead of relative paths
- Ensure the file has the correct permissions
- Check that the file hasn't been moved or deleted
If you get a 404 error when listing in-app purchases:
- Verify the app ID is correct (use
list-appsto double-check) - Ensure your API key has permission to access this app
- Check if the app exists in your App Store Connect account
The App Store Connect API has rate limits. If you encounter rate limiting:
- Wait a few minutes before retrying
- Reduce the frequency of your requests
- Consider implementing caching for frequently accessed data
appstoreconnect-storekitconfig-node/
βββ appstore.js # Main CLI entry point
βββ lib/
β βββ auth.js # JWT authentication module
β βββ api-client.js # App Store Connect API client
βββ .env.example # Example environment configuration
βββ .gitignore # Git ignore patterns
βββ package.json # Node.js project configuration
βββ README.md # This file
- Never commit your
.p8file or.envfile to version control - Keep your API keys secure and rotate them regularly
- Use environment variables instead of command-line arguments when possible to avoid exposing credentials in shell history
- Set appropriate file permissions on your
.p8file (e.g.,chmod 600)
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
For issues related to the CLI tool, please open an issue in the repository.
For App Store Connect API issues, refer to Apple's documentation.