![]() * Add dev app-sdk and rewrite undefined metadata to removing it * Implement metadata manager delete method * Update app-sdk to 0.39.1 in all packages * Update swift-boxes-drop.md |
||
---|---|---|
.. | ||
docs | ||
graphql | ||
public | ||
src | ||
.env.example | ||
.eslintrc | ||
.graphqlrc.yml | ||
CHANGELOG.md | ||
next-env.d.ts | ||
next.config.js | ||
package.json | ||
README.md | ||
saleor-app.ts | ||
sentry.client.config.js | ||
sentry.server.config.js | ||
tsconfig.json | ||
turbo.json | ||
types.ts |
Saleor App Klaviyo
Simple Klaviyo example app for Saleor
What's included?
- 🧩 Connection between Saleor and Klaviyo
- 🏆 4 built-in, example webhooks, that trigger Klaviyo metrics
- 🎨 Add new webhooks with ease
The stack
Klaviyo app is based on App Template - you can check it here
How to use this project
Requirements
- node v16
- pnpm
- Saleor Cloud account (free!) or local instance
- Saleor CLI
Saleor CLI for the win 🚀
Saleor CLI is designed to save you from the repetitive chores around Saleor development, including creating Apps. It will take the burden of spawning new apps locally, connecting them with Saleor environments, and establishing a tunnel for local development in seconds.
Local development
- Make sure you have installed required tools
- Clone repository
- Install app dependencies with
pnpm i
- Start dev server
pnpm dev
- To install app in your Saleor Instance and expose dev server to it, run in the separate terminal
saleor app tunnel
- Now you can access the app configuration at [your dashboard]/apps and click on [klavio]
- Read how to connect the app with the Klaviyo here
Local development without CLI
Add URL of your Saleor instance to the .env
file:
NEXT_PUBLIC_SALEOR_HOST_URL=https://your-saleor-instance.com
Install dependencies pnpm install
Start local server pnpm run dev
Follow the guide how install your app and use tunneling tools like localtunnel or ngrok in order to expose your local server.
If you use saleor-dashboard and your local server is exposed, you can install your app by following this link:
[YOUR_SALEOR_DASHBOARD_URL]/apps/install?manifestUrl=[YOUR_APPS_MANIFEST_URL]
Generated schema and typings
Commands build
and dev
would generate schema and typed functions using Saleor's GraphQL endpoint. Commit generated
folder to your repo as they are necessary for queries and keeping track of the schema changes.
Learn more about GraphQL code generation.
Storing registration data - APL
During registration process Saleor API pass the auth token to the app. With this token App can query Saleor API with privileged access (depending on requested permissions during the installation). To store this data, app-template use a different APL interfaces.
The choice of the APL is done using APL
environment variable. If value is not set, FileAPL is used. Available choices:
file
: no additional setup is required. Good choice for local development. Can't be used for multi tenant-apps or be deployed (not intended for production)upstash
: use Upstash Redis as storage method. Free account required. Can be used for development and production and supports multi-tenancy. RequiresUPSTASH_URL
andUPSTASH_TOKEN
environment variables to be set
If you want to use your own database, you can implement your own APL. Check the documentation to read more.