import { createAppRegisterHandler } from "@saleor/app-sdk/handlers/next";
import { saleorApp } from "@/saleor-app";

const allowedSaleorUrls = process.env.ALLOWED_SALEOR_URLS
  ? process.env.ALLOWED_SALEOR_URLS.split(",").map((url) => url.trim())
  : ["http://localhost:3000", "https://*.saleor.cloud"];

export default createAppRegisterHandler({
  apl: saleorApp.apl,
  allowedSaleorUrls,
});