appstore-connect-sdk 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -1
- package/dist/cjs/main.js +748 -480
- package/dist/cjs/main.js.map +4 -4
- package/dist/main.js +748 -470
- package/dist/main.js.map +4 -4
- package/dist/types/auth.d.ts +1 -1
- package/dist/types/main.d.ts +3 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -42,6 +42,11 @@ import { AppStoreConnectAPI } from "appstore-connect-sdk";
|
|
|
42
42
|
|
|
43
43
|
Go to [App Store Connect -> Users and Access -> Keys](https://appstoreconnect.apple.com/access/api) and create your own key. This is also the page to find your `private key ID` and the `issuer ID`.
|
|
44
44
|
|
|
45
|
+
The SDK supports both **Team API Keys** and **Individual API Keys**:
|
|
46
|
+
|
|
47
|
+
- **Team API Keys**: Used by teams, requires `issuerId`
|
|
48
|
+
- **Individual API Keys**: Used by individual developers, `issuerId` is not required
|
|
49
|
+
|
|
45
50
|
After downloading your private key, open the `.p8` file containing the private key in a text editor. It should look like this:
|
|
46
51
|
|
|
47
52
|
```
|
|
@@ -53,7 +58,7 @@ nNdXXbA4
|
|
|
53
58
|
-----END PRIVATE KEY-----
|
|
54
59
|
```
|
|
55
60
|
|
|
56
|
-
|
|
61
|
+
**For Team API Keys:**
|
|
57
62
|
|
|
58
63
|
```typescript
|
|
59
64
|
const client = new AppStoreConnectAPI({
|
|
@@ -63,6 +68,16 @@ const client = new AppStoreConnectAPI({
|
|
|
63
68
|
});
|
|
64
69
|
```
|
|
65
70
|
|
|
71
|
+
**For Individual API Keys:**
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
const client = new AppStoreConnectAPI({
|
|
75
|
+
// No issuerId required for Individual API Keys
|
|
76
|
+
privateKeyId: "<YOUR PRIVATE KEY ID>",
|
|
77
|
+
privateKey: "<YOUR PRIVATE KEY>",
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
66
81
|
For more information on how JWT works with the App Store Connect API, check out Apple's authentication guides:
|
|
67
82
|
|
|
68
83
|
- [Creating API Keys for App Store Connect API](https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api)
|
|
@@ -81,6 +96,8 @@ console.log(res);
|
|
|
81
96
|
|
|
82
97
|
Here's the complete code example:
|
|
83
98
|
|
|
99
|
+
**For Team API Keys:**
|
|
100
|
+
|
|
84
101
|
```typescript
|
|
85
102
|
import { AppStoreConnectAPI } from "appstore-connect-sdk";
|
|
86
103
|
import {
|
|
@@ -99,6 +116,26 @@ const res = await api.appsGetCollection();
|
|
|
99
116
|
console.log(res);
|
|
100
117
|
```
|
|
101
118
|
|
|
119
|
+
**For Individual API Keys:**
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
import { AppStoreConnectAPI } from "appstore-connect-sdk";
|
|
123
|
+
import {
|
|
124
|
+
AppsApi,
|
|
125
|
+
AppEventLocalizationsApi,
|
|
126
|
+
} from "appstore-connect-sdk/openapi";
|
|
127
|
+
|
|
128
|
+
const client = new AppStoreConnectAPI({
|
|
129
|
+
// No issuerId for Individual API Keys
|
|
130
|
+
privateKeyId: "<YOUR PRIVATE KEY ID>",
|
|
131
|
+
privateKey: "<YOUR PRIVATE KEY>",
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
const api = await client.create(AppsApi);
|
|
135
|
+
const res = await api.appsGetCollection();
|
|
136
|
+
console.log(res);
|
|
137
|
+
```
|
|
138
|
+
|
|
102
139
|
### Custom network libraries
|
|
103
140
|
|
|
104
141
|
By default, AppStoreConnectAPI uses its built-in `fetch` function for HTTP requests. Note that this function requires Node.js version **18.0.0** or higher.
|