TypeScript type definitions for Wildberry that can be used across different JavaScript frameworks including React, React Native, and Next.js.
npm install wildberry-types
# or
yarn add wildberry-types
# or
pnpm add wildberry-typesimport { CustomerInfo, MakePurchaseResult } from 'wildberry-types';
const handlePurchase = (result: MakePurchaseResult) => {
// Type-safe access to purchase result
console.log(result.customerInfo);
console.log(result.transaction);
};import { CustomerInfo, MakePurchaseResult } from 'wildberry-types';
// Use the types in your React Native components
type Props = {
customerInfo: CustomerInfo;
};
const CustomerProfile: React.FC<Props> = ({ customerInfo }) => {
// Type-safe access to customer info
return (
<View>
<Text>User ID: {customerInfo.originalAppUserId}</Text>
<Text>First Seen: {customerInfo.firstSeen}</Text>
</View>
);
};CustomerInfo- Customer information including entitlements and subscription detailsPurchasesOfferings- Available offerings and productsTransaction- Purchase transaction detailsMakePurchaseResult- Result of a purchase operationLogInResult- Result of a login operationWebPurchaseRedemptionResult- Result of a web purchase redemptionPurchasesError- Error information
MIT