Indie Kit DocsIndie Kit Docs
Setup

Plan Management Setup

Learn how to configure and manage subscription plans in your Indie Kit application

Plan Management Setup 💰

Indie Kit provides a powerful plan management system. Let's learn how to configure it! 🚀

Managing Plans ⚡

Access the plan management dashboard at /super-admin/plans (requires super admin access).

Plan Configuration 📋

Each plan has these key properties:

{
  name: "Basic Plan",           // Display name
  codename: "basic",           // Unique identifier
  default: true,              // If true, assigned to new signups
  
  // Pricing Options
  hasMonthlyPricing: boolean,
  hasYearlyPricing: boolean,
  hasOnetimePricing: boolean,
 
  // Prices (in cents)
  monthlyPrice: 1000,         // $10.00
  yearlyPrice: 10000,         // $100.00
  onetimePrice: 50000,        // $500.00
 
  // Features
  featuresList: ["Feature 1", "Feature 2"],
  quotas: {
    canUseApp: true,
    numberOfThings: 10,
    somethingElse: "value"
  }
}

Default Plan 🎯

  • Set default: true for one plan
  • This plan will be automatically assigned to new users
  • Default plan has no expiry
  • Users keep this plan until they upgrade

Configuring Quotas ⚙️

Define your plan quotas in src/db/schema/plans.ts:

export const quotaSchema = z.object({
  canUseApp: z.boolean().default(true),
  numberOfThings: z.number(),
  somethingElse: z.string(),
})

Customize these fields based on your app's needs:

  • Add boolean flags for features
  • Set numerical limits
  • Define string-based configurations

Example Quota Configuration 📝

// Example quotas for different plans
const freeQuotas = {
  canUseApp: true,
  numberOfThings: 5,
  somethingElse: "basic"
}
 
const proQuotas = {
  canUseApp: true,
  numberOfThings: 100,
  somethingElse: "premium"
}

Plan Schema Reference 📚

The complete plan schema includes:

{
  id: "uuid",
  name: "string",
  codename: "string",
  default: boolean,
 
  // Pricing Types
  hasOnetimePricing: boolean,
  hasMonthlyPricing: boolean,
  hasYearlyPricing: boolean,
 
  // Pricing Details
  monthlyPrice: number,
  monthlyPriceAnchor: number,
  monthlyStripePriceId: string,
  monthlyLemonSqueezyProductId: string,
 
  yearlyPrice: number,
  yearlyPriceAnchor: number,
  yearlyStripePriceId: string,
  yearlyLemonSqueezyProductId: string,
 
  onetimePrice: number,
  onetimePriceAnchor: number,
  onetimeStripePriceId: string,
  onetimeLemonSqueezyProductId: string,
 
  // Features & Quotas
  featuresList: string[],
  quotas: QuotaSchema
}

Next Steps 🔜

After configuring plans:

  1. Set up Stripe for payment processing
  2. Set up LemonSqueezy for alternative payment processing
  3. Test the upgrade flow
  4. Monitor plan assignments

Now your Indie Kit application is ready to handle different subscription plans! 🎉

On this page