Typescript typings for Apple in-app purchases. Use to add strong types to Apple verifying receipts for in-app purchases and Apple Server to Server notifications.
Before:
const responseBody: any = // Notification from Apple or HTTP response body from verifying a receipt.
const latestTransactions: any = responseBody.latest_receipt_info // Hope there isn't a typo in there or you will have a runtime exception!
After:
const responseBody: AppleVerifyReceiptResponseBody = // Notification from Apple or HTTP response body from verifying a receipt.
const latestTransactions: AppleLatestReceiptTransaction[] = responseBody.latest_receipt_info // Ah! Much better!
Tip: Check out the npm module dollabill-apple
to make your life much easier working with Apple verifying receipts and server-to-server notifications.
Here you will find the full API reference for all of the typings in this repo.
npm install --save-dev types-apple-iap
import {AppleVerifyReceiptResponseBody, AppleServerNotificationResponseBody} from "types-apple-iap"
const responseBody: AppleVerifyReceiptResponseBody = // HTTP response body from verifying a receipt. const notificationResponseBody: AppleServerNotificationResponseBody = // Notification from Apple.
## Contributors
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key))
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/levibostian"><img src="https://avatars1.githubusercontent.com/u/2041082?v=4" width="100px;" alt=""/><br /><sub><b>Levi Bostian</b></sub></a><br /><a href="https://github.com/levibostian/types-apple-iap/commits?author=levibostian" title="Code">💻</a> <a href="https://github.com/levibostian/types-apple-iap/commits?author=levibostian" title="Documentation">📖</a> <a href="#maintenance-levibostian" title="Maintenance">🚧</a></td>
</tr>
</table>
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
Generated using TypeDoc
Official Apple documentation Official Apple documentation