Hostinger Horizons: How to sell subscriptions with Stripe

Updated 2 months ago

We recommend using Stripe if you want to sell subscriptions. You can also connect other third-party tools, but this guide focuses on Stripe.

If you want to sell physical or digital products, we recommend using our built-in online store integration.

 

Step 1: Connect your domain

You’ll need to have a custom domain connected to your project when creating a Stripe account, so connect it before continuing.

  1. Click Publish in the top-right corner.
  2. When you see the “Project published” message, click Get domain.
  3. Choose an existing domain or buy a new one.

 

Step 2: Connect Supabase to your project

Supabase provides everything you need for secure subscription handling, user account creation, data storage, and other back-end features.

Integrating Supabase early in the process makes the entire building experience easier, so we recommend connecting it before you start adjusting your project with features like user accounts, subscription purchases, or other complex functionality.

Check this article to learn how to connect Supabase to your project.

 

Step 3: Add sign up / log in functionality to your project

With subscriptions, you’ll most likely also need to add user account creation functionality so the subscriptions you sell are connected to user accounts. We recommend adding sign up / log in functionality before connecting Stripe.

Message example:

Add sign-up and login flows to my project and securely connect them with Supabase integration.

If you have already added it, you can ask AI to check if it’s fully connected with Supabase.

Message example

Check if sign-up and login flows are fully and securely integrated with Supabase authentication. I plan to use Stripe for subscriptions, so ensure user accounts are properly managed on the Supabase side.

For easier project testing, you can disable email confirmations for newly created accounts in your project. Follow these steps to do so:

  1. Open the Supabase dashboard.
  2. Select the Supabase organization and project that is connected to your Horizons site.
  3. In the left sidebar, find and open Authentication settings.
  4. In the left sidebar, find and open Sign In / Providers.
  5. Disable the Confirm email setting.

 

Step 4: Set up your Stripe account & subscription

First, you’ll need to create your Stripe account (or log in if you already have one) and set up the subscription product that you want to sell.

  1. Create a Stripe account: If you haven’t already, sign up for a Stripe account.
    • Once you create an account, you’ll be redirected to Stripe Sandbox mode. This mode allows you to test Stripe integration before fully connecting it.
    • If you don’t have much experience with tools like Stripe, we recommend fully setting up your Stripe account from the start. To do that, press the “Switch to live account” button in the top-right corner and continue creating your live Stripe account.
  2. Create subscription:
    • Go to the Product catalog in your Stripe dashboard.
    • Click + Add a product.
    • Give it a name (e.g., “Pro Plan”) and set a recurring price. For testing purposes, we recommend setting the price to 0 for now. This allows you to test the purchase flow without paying the subscription price. You can adjust the price later.
    • After creating it, copy the Price ID. You can find it by opening your created product → click the 3-dots icon → click Copy price ID (it will look like price_...). Copy and save it somewhere safe, you’ll need this later.