Self-host the
open source API

SubTru is an open source API that receives subscription events from Stripe, the Apple App Store, and Google Play and transforms them into PostgreSQL database subscription rows. You can call the API's GET /access endpoint to check a user's product access.

GET /v1/projects/your_project_id/users/active_user/access

Response

Sending...

Setup steps

Check out the README on GitHub for more detail.

  1. 1

    Create your database

    This is where data about your project and your user's subscriptions will be stored. Run at least subtru/db/migrations 001 through 008 on an empty PostgreSQL database. Migration 009 is optional and recommended in production, where it adds a restricted runtime database role.

  2. 2

    Configure the SubTru API

    The API is how you will create your project, receive subscription events, and check your users' product access. To configure the API, just set the secrets specified in the README on GitHub.

  3. 3

    Run the Docker container

    The SubTru API runs on a Docker container. Use the Dockerfile in the SubTru repo to deploy the container on your platform of choice. Then check /health/ready to verify the API is running and connected to your database.

  4. 4

    Create a project

    Once you have deployed your API, you can create your first project using the POST /v1/projects endpoint and the SubTru admin API key you saved to the secrets. A single project can be used for both test and production subscriptions.

  5. 5

    Connect providers

    For providers to send subscription events to your API, you must create a webhook URL using POST /v1/projects/{projectId}/webhook-keys and configure it on the provider's platform. You must also add the provider-specific configurations to your project (these vary between Stripe, Apple, and Google Play). The README on GitHub has detailed steps for provider configuration. You can use any combination of providers. Once configuration is complete, create a test subscription event to confirm the events are arriving properly. Once you've received at least one event, you should be able to check a user's subscription status using GET /v1/projects/{projectId}/users/{externalUserId}/access.

Self-hosting questions

SubTru is licensed under Apache 2.0.
Last updated: October 4, 2026