/saleor-best-app

🦄 T h e b e s t s a e l o r a p p

Primary LanguageTypeScript

Saleor App, Next.js example

Bare-bones example app with webhook on product update.

Useful resources:

Apps guide

Configuring apps in dashboard

Disclaimer

This is not official Saleor project. Treat this project more as proof of concept, there are no security checks on webhooks and rest of the app is not tested to be released on production.

Installation

  1. In App directory create file .env.local, use .env.local.sample as a reference.

  2. Add Saleor URI to the .env.local. If you don't have running instance of Saleor, you create a free dev account or run instance locally

  3. You'll need yarn to install dependencies.

yarn install

How to add app to Saleor?

For local development you can use localtunnel or ngrok to expose your app.

  1. Start App dev server

$ yarn dev

  1. Run appInstall mutation from graphql client (MANAGE_APPS permission required!)
mutation {
  appInstall(
    input: {
      appName: "Best App"
      manifestUrl: "https://your.app.url"
      permissions: [MANAGE_PRODUCTS]
    }
  ) {
    appInstallation {
      id
      status
      appName
      manifestUrl
    }
    appErrors {
      field
      message
      code
      permissions
    }
  }
}
  1. That's it! 🦄