{"_id":"@billdog.io/expo","_rev":"3-448fa090cbf205a175a7925c7eb669ca","name":"@billdog.io/expo","dist-tags":{"beta":"1.0.1-beta.2","latest":"1.0.1-beta.2"},"versions":{"1.0.0-beta.2":{"name":"@billdog.io/expo","version":"1.0.0-beta.2","keywords":["expo","react-native","paywall","billdog","subscriptions","in-app-purchases"],"author":{"name":"BillDog"},"license":"MIT","_id":"@billdog.io/expo@1.0.0-beta.2","maintainers":[{"name":"billdog","email":"sdks@billdog.io"}],"dist":{"shasum":"4d9b2d868f372bf0565f75096e05926c2281e830","tarball":"https://registry.npmjs.org/@billdog.io/expo/-/expo-1.0.0-beta.2.tgz","fileCount":17,"integrity":"sha512-9/HRLoW2L7JG3oaqvPHHx/rfiBIklQ7xKOETS9NH4te3xUs4ny072G3LuAriNPJYOmOA3Xn5fr8rDZh42P0Fug==","signatures":[{"sig":"MEYCIQDuV4xvbtCysey8lomzvAsIbAp8fAEAZic9U/sF8z2+NgIhAKXZfMn/O4/5ktWLFqo1JCwKLGje0HuD9K2cGl9HX06z","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30583},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"fb8d10b02083b7bece959bd821ff29f9562d825e","scripts":{"test":"jest","build":"tsc","prepare":"npm run build"},"_npmUser":{"name":"billdog","email":"sdks@billdog.io"},"_npmVersion":"11.12.1","description":"Expo-compatible paywall rendering library for BillDog","directories":{},"_nodeVersion":"24.15.0","dependencies":{"expo-modules-core":"^1.11.0","@billdog.io/react-native":"^1.0.0-beta.2"},"_hasShrinkwrap":false,"devDependencies":{"expo":"^50.0.0","jest":"^29.7.0","react":"^18.2.0","ts-jest":"^29.4.12","typescript":"^5.0.0","@types/jest":"^29.5.14","@types/react":"^18.0.0","react-native":"0.72.17","expo-constants":"^15.0.0","@billdog.io/react-native":"file:../react-native"},"peerDependencies":{"expo":">=50.0.0","react":">=16.8.0","react-native":">=0.60.0","expo-constants":">=15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/expo_1.0.0-beta.2_1784912757980_0.6015137645769544","host":"s3://npm-registry-packages-npm-production"}},"1.0.1-beta.2":{"name":"@billdog.io/expo","version":"1.0.1-beta.2","keywords":["expo","react-native","paywall","billdog","subscriptions","in-app-purchases"],"author":{"name":"BillDog"},"license":"MIT","_id":"@billdog.io/expo@1.0.1-beta.2","maintainers":[{"name":"billdog","email":"sdks@billdog.io"}],"dist":{"shasum":"8559f3f80d92aa42d6d79f89a8738f7a3c2f4f69","tarball":"https://registry.npmjs.org/@billdog.io/expo/-/expo-1.0.1-beta.2.tgz","fileCount":17,"integrity":"sha512-NnqvQTLFf9+/I1vDK08A7vcVmtWYmRNvKUBqDMGd/evSd9+Wp5fMD0VxwwxRyjTZRfmQH+eyYguTyEV5gHweXQ==","signatures":[{"sig":"MEUCIQDAtmMLpR/TmJ9QF/ztvmSUJjMVFhsy4Ondg+hu0Im+7AIgIBBL36EovB5jYo7m1sVQCNsm/ZNr20bQswQ+GloTXw8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31218},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"b4473161db174ad0823c1c1c43c9f6902ba5ee23","scripts":{"test":"jest","build":"tsc","prepare":"npm run build"},"_npmUser":{"name":"billdog","email":"sdks@billdog.io"},"_npmVersion":"11.12.1","description":"Expo-compatible paywall rendering library for BillDog","directories":{},"_nodeVersion":"24.15.0","dependencies":{"expo-modules-core":"^1.11.0","@billdog.io/react-native":"^1.0.1-beta.2"},"_hasShrinkwrap":false,"devDependencies":{"expo":"^50.0.0","jest":"^29.7.0","react":"^18.2.0","ts-jest":"^29.4.12","typescript":"^5.0.0","@types/jest":"^29.5.14","@types/react":"^18.0.0","react-native":"0.72.17","expo-constants":"^15.0.0","@billdog.io/react-native":"file:../react-native"},"peerDependencies":{"expo":">=50.0.0","react":">=16.8.0","react-native":">=0.60.0","expo-constants":">=15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/expo_1.0.1-beta.2_1786277121303_0.4985062818852193","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-07-24T17:05:57.806Z","modified":"2026-08-09T12:06:09.023Z","1.0.0-beta.2":"2026-07-24T17:05:58.115Z","1.0.1-beta.2":"2026-08-09T12:05:21.437Z"},"author":{"name":"BillDog"},"license":"MIT","keywords":["expo","react-native","paywall","billdog","subscriptions","in-app-purchases"],"description":"Expo-compatible paywall rendering library for BillDog","maintainers":[{"name":"billdog","email":"sdks@billdog.io"}],"readme":"# BillDog Expo Paywalls SDK\n\nExpo-compatible paywall rendering library for BillDog. Display beautiful, high-converting subscription paywalls in your Expo app with smart caching, A/B testing, and analytics built-in.\n\n## Features\n\n- ✅ **Expo Compatible**: Works seamlessly with Expo managed workflow and EAS Build\n- ✅ **Smart Caching**: Intelligent prefetching and offline support\n- ✅ **A/B Testing**: Built-in experiment support\n- ✅ **Analytics**: Track conversions and user behavior automatically\n- ✅ **Variable Substitution**: Personalize paywalls with user data\n- ✅ **Custom Themes**: Match your app's design system\n- ✅ **TypeScript**: Full type safety\n\n## Installation\n\n### For Expo SDK 50+\n\n```bash\nnpx expo install @billdog.io/expo\n```\n\n### Add Config Plugin\n\nAdd the plugin to your `app.json`:\n\n```json\n{\n  \"expo\": {\n    \"plugins\": [\n      \"@billdog.io/expo\"\n    ]\n  }\n}\n```\n\n### Rebuild Your App\n\nAfter adding the plugin, you need to rebuild your app:\n\n```bash\n# For EAS Build\neas build --platform all\n\n# For local development builds\nnpx expo run:ios\nnpx expo run:android\n```\n\n## Quick Start\n\n```tsx\nimport { PaywallView } from '@billdog.io/expo';\n\nexport default function SubscriptionScreen() {\n  return (\n    <PaywallView\n      paywallIdentifier=\"premium_offer\"\n      apiKey=\"your_api_key_here\"\n      projectUrl=\"https://yourproject.supabase.co\"\n      onButtonPress={(buttonId, action) => {\n        console.log('Button pressed:', buttonId, action);\n        // Handle purchase action\n      }}\n      onDismiss={() => {\n        console.log('Paywall dismissed');\n      }}\n    />\n  );\n}\n```\n\n## Using with Expo Go\n\n**Important**: Native paywall rendering requires a custom development build and won't work in Expo Go. For Expo Go compatibility, use the REST API approach:\n\n```tsx\nimport { useOfferings } from '@billdog.io/expo';\n\nfunction MyPaywall() {\n  const { offerings, loading } = useOfferings({\n    apiKey: 'your_api_key',\n    projectUrl: 'https://yourproject.supabase.co',\n  });\n\n  if (loading) return <Text>Loading...</Text>;\n\n  return (\n    <View>\n      {offerings?.map(offering => (\n        <View key={offering.id}>\n          <Text>{offering.name}</Text>\n          {/* Render custom UI */}\n        </View>\n      ))}\n    </View>\n  );\n}\n```\n\n## Advanced Features\n\n### Smart Caching\n\nEnable advanced caching for faster load times:\n\n```tsx\nimport { PaywallView } from '@billdog.io/expo';\n\n<PaywallView\n  paywallIdentifier=\"premium_offer\"\n  apiKey=\"your_api_key\"\n  projectUrl=\"https://yourproject.supabase.co\"\n  enableCache={true}\n  cacheConfig={{\n    maxAge: 3600000, // 1 hour\n    staleWhileRevalidate: 86400000, // 24 hours\n    prefetchRelated: true,\n  }}\n/>\n```\n\n### Variable Substitution\n\nPersonalize paywalls with user data:\n\n```tsx\n<PaywallView\n  paywallIdentifier=\"premium_offer\"\n  apiKey=\"your_api_key\"\n  projectUrl=\"https://yourproject.supabase.co\"\n  variables={{\n    user_name: 'John',\n    trial_days: '7',\n    discount_percentage: '50',\n  }}\n/>\n```\n\n### A/B Testing\n\nPaywalls automatically participate in experiments:\n\n```tsx\n<PaywallView\n  paywallIdentifier=\"premium_offer\"\n  apiKey=\"your_api_key\"\n  projectUrl=\"https://yourproject.supabase.co\"\n  userContext={{\n    user_id: 'user_123',\n    segment: 'power_users',\n  }}\n/>\n```\n\n### Custom Loading & Error States\n\n```tsx\n<PaywallView\n  paywallIdentifier=\"premium_offer\"\n  apiKey=\"your_api_key\"\n  projectUrl=\"https://yourproject.supabase.co\"\n  LoadingComponent={() => (\n    <View style={styles.loading}>\n      <ActivityIndicator size=\"large\" />\n      <Text>Loading your offer...</Text>\n    </View>\n  )}\n  ErrorComponent={({ error, retry }) => (\n    <View style={styles.error}>\n      <Text>Oops! {error.message}</Text>\n      <Button title=\"Retry\" onPress={retry} />\n    </View>\n  )}\n/>\n```\n\n## Hooks API\n\n### usePaywall\n\nFetch a single paywall with caching:\n\n```tsx\nimport { usePaywall } from '@billdog.io/expo';\n\nfunction MyComponent() {\n  const { configuration, loading, error, refetch } = usePaywall({\n    paywallIdentifier: 'premium_offer',\n    apiKey: 'your_api_key',\n    projectUrl: 'https://yourproject.supabase.co',\n    enableCache: true,\n  });\n\n  if (loading) return <Text>Loading...</Text>;\n  if (error) return <Text>Error: {error.message}</Text>;\n\n  return <Text>Paywall: {configuration?.name}</Text>;\n}\n```\n\n### useOfferings\n\nFetch all offerings with pagination:\n\n```tsx\nimport { useOfferings } from '@billdog.io/expo';\n\nfunction OfferingsScreen() {\n  const { \n    offerings, \n    loading, \n    error, \n    hasMore, \n    loadMore \n  } = useOfferings({\n    apiKey: 'your_api_key',\n    projectUrl: 'https://yourproject.supabase.co',\n    limit: 10,\n  });\n\n  return (\n    <FlatList\n      data={offerings}\n      renderItem={({ item }) => <OfferingCard offering={item} />}\n      onEndReached={loadMore}\n      ListFooterComponent={loading ? <ActivityIndicator /> : null}\n    />\n  );\n}\n```\n\n## Utilities\n\n### Expo Go Detection\n\n```tsx\nimport { isExpoGo, isStandaloneBuild } from '@billdog.io/expo';\n\nif (isExpoGo()) {\n  console.log('Running in Expo Go - use REST API approach');\n} else if (isStandaloneBuild()) {\n  console.log('Running in standalone build - full native support');\n}\n```\n\n## Configuration Options\n\n| Prop | Type | Required | Description |\n|------|------|----------|-------------|\n| `paywallIdentifier` | `string` | Yes | Unique identifier for the paywall |\n| `apiKey` | `string` | Yes | Your BillDog API key |\n| `projectUrl` | `string` | Yes | Your Supabase project URL |\n| `configuration` | `PaywallConfiguration` | No | Direct configuration (bypasses API) |\n| `onButtonPress` | `(id: string, action: any) => void` | No | Button press handler |\n| `onDismiss` | `() => void` | No | Dismiss handler |\n| `variables` | `Record<string, string>` | No | Variable substitution values |\n| `userContext` | `Record<string, any>` | No | User context for A/B testing |\n| `enableCache` | `boolean` | No | Enable smart caching (default: false) |\n| `cacheConfig` | `CacheConfig` | No | Advanced cache configuration |\n| `LoadingComponent` | `React.ComponentType` | No | Custom loading component |\n| `ErrorComponent` | `React.ComponentType` | No | Custom error component |\n\n## TypeScript Support\n\nFull TypeScript definitions included:\n\n```tsx\nimport type {\n  PaywallConfiguration,\n  PaywallComponent,\n  OfferingPackage,\n  UsePaywallOptions,\n  UseOfferingsOptions,\n} from '@billdog.io/expo';\n```\n\n## Troubleshooting\n\n### \"Native module not found\" Error\n\nMake sure you've:\n1. Added the plugin to `app.json`\n2. Rebuilt your app with `eas build` or `npx expo run:ios/android`\n3. Installed all dependencies with `npx expo install`\n\n### Paywall Not Displaying in Expo Go\n\nNative paywall rendering requires a custom build. Use the REST API approach with `useOfferings` hook for Expo Go compatibility.\n\n### Cache Not Working\n\nEnsure you've enabled caching:\n```tsx\n<PaywallView enableCache={true} />\n```\n\n### Analytics Events Not Firing\n\nCheck that your API key has analytics permissions and that you're passing `userContext` for user tracking.\n\n## Migration from React Native SDK\n\nIf you're migrating from `@billdog.io/react-native`, simply:\n\n1. Replace imports:\n```tsx\n// Before\nimport { PaywallView } from '@billdog.io/react-native';\n\n// After\nimport { PaywallView } from '@billdog.io/expo';\n```\n\n2. Add the config plugin to `app.json`\n3. Rebuild your app\n\nAll APIs are identical!\n\n## Next Steps\n\n- [iOS In-App Purchase Integration](https://docs.billdog.app/guides/ios-iap)\n- [Android In-App Purchase Integration](https://docs.billdog.app/guides/android-iap)\n- [A/B Testing Guide](https://docs.billdog.app/guides/ab-testing)\n- [Analytics Dashboard](https://docs.billdog.app/guides/analytics)\n\n## Support\n\n- **Documentation**: https://docs.billdog.app\n- **GitHub Issues**: https://github.com/billdog/expo-paywalls/issues\n- **Discord**: https://discord.gg/billdog\n\n## License\n\nMIT © BillDog\n","readmeFilename":"README.md"}