Create a new app using Shopify CLI
The fastest way to get started is using the Shopify CLI with the template:This command will:
- Clone the repository
- Install all dependencies automatically
- Set up the project structure
Make sure you have Shopify CLI installed before running this command.
Install dependencies
If you cloned the repository manually, install dependencies using your preferred package manager:The app uses Node.js and includes dependencies like:
- Remix for the web framework
- Prisma for database management
- Shopify App Bridge and Polaris for UI
Set up the database
Initialize the database with Prisma:This command runs:
prisma generate- Generates the Prisma Clientprisma migrate deploy- Applies database migrations
prisma/data.db.Start the development server
Launch the app with the Shopify CLI:This will:
- Start the Remix development server
- Open a tunnel for local development
- Launch your browser with the app installation URL
Install the app on your development store
- Click the Preview URL from the terminal output
- Click Install app in your Shopify admin
- Review and approve the required permissions
- Customer read/write permissions
- Order read/write permissions
- Subscription contract management
- Payment method management
- Product and metaobject access
Create your first subscription plan
Now that the app is installed, create a selling plan:
- In the app, navigate to Plans from the main navigation
- Click Create plan
- Fill in the plan details:
- Plan name (e.g., “Monthly Coffee Subscription”)
- Billing frequency (e.g., every 1 month)
- Delivery frequency
- Select products to include in the plan
- Click Save
Understanding Selling Plans
Learn more about how selling plans work in Shopify’s subscription system
Test subscription checkout
To test the subscription flow:
- Go to your online store
- Add a product with a subscription plan to your cart
- Select the subscription option at checkout
- Complete a test purchase using Shopify’s test payment methods
Next steps
Now that you have the app running, explore these features:Installation Details
Learn about prerequisites, environment variables, and configuration options
Managing Contracts
Understand how subscription contracts work
Billing & Payments
Configure billing schedules and handle payment failures
Extensions
Extend the app with custom UI and functionality
Troubleshooting
App won't start - database connection error
App won't start - database connection error
Make sure you’ve run the setup command:This generates the Prisma client and creates the database file.
Missing scopes error
Missing scopes error
If you see a missing scopes error, you need to update the app scopes:
- Stop the development server
- Run
npm run devagain - Reinstall the app when prompted
shopify.app.toml.GraphQL errors or type issues
GraphQL errors or type issues
Regenerate the GraphQL types:This updates type definitions from Shopify’s Admin API schema.
For more detailed setup instructions and advanced configuration, see the Installation Guide.