RevenueCat is a scalable backend for in-app subscriptions and purchases that simplifies the process of building a mobile business. With its robust features, you can focus on developing your app without worrying about setting up or maintaining purchase infrastructure. In this article, we'll explore three integration patterns for incorporating RevenueCat into your app startup ideas.
Option 1: Leverage RevenueCat's Scalable Backend
When starting from scratch, you can rely solely on RevenueCat to power in-app purchases and subscriptions. This approach is ideal for developers who want to replace outdated or unloved subscription infrastructure with a state-of-the-art, fully maintained platform. By using RevenueCat's Purchases SDK, you can securely build subscriptions in your app without worrying about the underlying architecture. Our quickstart guide provides code samples to get you up and running quickly.
Option 2: Combine Client-Side Code with RevenueCat
In some cases, you may need to respond to subscription-related events with custom logic that can't be handled by client-side code alone. This might include updating values in your database or powering an out-of-app experience in response to a subscription lifecycle event. With this integration pattern, you'll use the RevenueCat Purchases SDK for purchases and handle everything on the client, while your server sits alongside the RevenueCat backend to keep data synced with a user's subscription status.
Webhooks: A Key Component of Option 2
RevenueCat provides webhooks that fire for various event types, including initial purchases, renewals, cancellations, and more. These events are triggered when a change occurs in a user's subscription status. By responding to these events via webhooks, you can make necessary updates only when RevenueCat detects the change. This integration pattern is ideal for developers who need to pull information about subscribers or update values in their database.
Option 3: Enhance Existing Purchase Code with RevenueCat Features
This integration pattern is perfect for larger apps that want to use some RevenueCat features without rewriting existing purchase code. By sitting alongside your existing purchase code, RevenueCat listens for transactions and securely stores them in its backend. With this setup, you can take advantage of features like webhooks, integrations, data exports, and more.
Choose the Right Integration Pattern for Your App
RevenueCat provides simple tools to handle complex development of mobile subscriptions. These three integration patterns are great starting points for thinking about how RevenueCat can fit into your app:
- Using only the RevenueCat Purchases SDK
- Using a combination of the RevenueCat Purchases SDK with your own backend server logic
- Using RevenueCat as an integration hub to send accurate subscription events to all your existing software
Depending on your app's development stage and complexity, it may be helpful to explore each integration pattern in more detail to determine which approach best suits your needs.