Skip to content

ProjWildBerry/wildberry-types

Repository files navigation

Wildberry Types

TypeScript type definitions for Wildberry that can be used across different JavaScript frameworks including React, React Native, and Next.js.

Installation

npm install wildberry-types
# or
yarn add wildberry-types
# or
pnpm add wildberry-types

Usage

React / Next.js

import { CustomerInfo, MakePurchaseResult } from 'wildberry-types';

const handlePurchase = (result: MakePurchaseResult) => {
  // Type-safe access to purchase result
  console.log(result.customerInfo);
  console.log(result.transaction);
};

React Native

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>
  );
};

Available Types

  • CustomerInfo - Customer information including entitlements and subscription details
  • PurchasesOfferings - Available offerings and products
  • Transaction - Purchase transaction details
  • MakePurchaseResult - Result of a purchase operation
  • LogInResult - Result of a login operation
  • WebPurchaseRedemptionResult - Result of a web purchase redemption
  • PurchasesError - Error information

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published