Frequently Asked Questions
General Questions
What is the Shopify Vue App template?
This template provides a comprehensive foundation for building Shopify applications using Vue.js 3.5. It includes authentication, API integration, internationalization, and webhook handling, all preconfigured to work seamlessly together.
Is this an official Shopify template?
No, this is a community-built template that extends Shopify's official Node.js template by adding a Vue.js frontend and additional features. It follows all Shopify's best practices and guidelines.
What versions of Vue does this template use?
The template uses:
- Vue 3.5 with the Composition API
- Vue Router 4.x for routing
- Pinia for state management
- Vue i18n for internationalization
Development Questions
How do I connect to a database in production?
The template uses SQLite by default for development, but switching to MySQL or PostgreSQL in production is straightforward:
For MySQL:
import { MySQLSessionStorage } from '@shopify/shopify-app-session-storage-mysql'
// In shopify.js
sessionStorage: process.env.NODE_ENV === 'production'
? MySQLSessionStorage.withCredentials(
process.env.DATABASE_HOST,
process.env.DATABASE_SESSION,
process.env.DATABASE_USER,
process.env.DATABASE_PASSWORD,
{ connectionPoolLimit: 100 }
)
: new SQLiteSessionStorage(DB_PATH)
For PostgreSQL:
import { PostgreSQLSessionStorage } from '@shopify/shopify-app-session-storage-postgresql'
sessionStorage: PostgreSQLSessionStorage.withCredentials(
process.env.DATABASE_HOST,
process.env.DATABASE_SESSION,
process.env.DATABASE_USER,
process.env.DATABASE_PASSWORD
)
How do I add new GraphQL queries?
- Create your queries in
src/graphql/
directory - Use the Shopify GraphiQL app to test your queries
- Implement them in your components:
const client = new shopify.api.clients.Graphql({ session })
const response = await client.request(YOUR_QUERY)
How do I handle app authentication?
Authentication is handled automatically through:
- Shopify OAuth flow
- Session tokens
- App Bridge authentication
All middleware is preconfigured - you typically don't need to modify this unless you have custom requirements.
What's the best way to customize the UI?
The template provides several approaches:
- Create custom components in
src/components/
- Modify existing components to match your design
- Use CSS variables for theming:css
:root { --primary-color: #your-brand-color; --secondary-color: #your-secondary-color; }
How do I implement billing?
Enable billing by configuring the billingConfig in shopify.js
:
const billingConfig = {
'My Shopify Charge': {
amount: 5.0,
currencyCode: 'USD',
interval: BillingInterval.Every30Days
}
}
How do I add new webhooks?
- Define your webhook handler in
web/server/webhooks/
:
export default {
YOUR_WEBHOOK_TOPIC: {
deliveryMethod: DeliveryMethod.Http,
callbackUrl: '/api/webhooks',
callback: async (topic, shop, body) => {
// Your webhook logic
}
}
}
- Register it in your app's admin dashboard
How do I resolve CORS errors during development?
CORS issues usually arise from:
- Misconfigured hostnames
- Incorrect app URL in Shopify Partners dashboard
- Missing proxy settings
To resolve:
- Verify your
shopify.app.toml
configuration - Ensure dev domain matches preview URL
- Check proxy settings in
vite.config.js
- Run
npm run dev:reset
followed bynpm run deploy
How do I manage environment variables?
Development:
- Use
.env
file for local development - Run
npm run dev:reset
to configure app
- Use
Production:
- Run
npm run show:env
to get required variables - Set them in your hosting platform:
SHOPIFY_API_KEY=<your_key> SHOPIFY_API_SECRET=<your_secret> SCOPES=<your_scopes> HOST=<your_host>
- Run
How do I deploy to production?
Multiple deployment options are available:
- Using Docker:
docker build --build-arg SHOPIFY_API_KEY=<key> \
--build-arg SHOPIFY_API_SECRET=<secret> \
--build-arg SCOPES=<scopes> \
--build-arg HOST=<host> \
-t your-app-name .
Traditional Hosting:
- Build frontend:
npm run build
- Set environment variables
- Start server:
npm run serve
- Build frontend:
Platform Specific:
- Heroku: Use the provided Procfile
- Render: Use build.sh script
- Digital Ocean: Use App Platform configuration
Still Need Help?
Join our community or reach out to our contributors:
- Open an issue on GitHub
- Check our documentation
- Contact us for professional support