Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
so in the shopify docs its saying that we can subscribe to webhook using app configuration file (toml) or using the API in the shopify.server file.
so in the toml file there is already an webhook for app uninstalled config like this
[webhooks]
api_version = "2024-07"
[[webhooks.subscriptions]]
topics = [ "app/uninstalled" ]
uri = "/webhooks"
if I uninstall my app nothing is happening in the webhooks routes
but if I add in the shopify server file like this its working dont know why ?
const shopify = shopifyApp({
apiKey: process.env.SHOPIFY_API_KEY,
apiSecretKey: process.env.SHOPIFY_API_SECRET || "",
apiVersion: ApiVersion.July24,
scopes: process.env.SCOPES?.split(","),
appUrl: process.env.SHOPIFY_APP_URL || "",
authPathPrefix: "/auth",
sessionStorage: new MongoDBSessionStorage(process.env.mongodb_url),
distribution: AppDistribution.AppStore,
restResources,
future: {
unstable_newEmbeddedAuthStrategy: true,
},
...(process.env.SHOP_CUSTOM_DOMAIN
? { customShopDomains: [process.env.SHOP_CUSTOM_DOMAIN] }
: {}),
webhooks: {
APP_UNINSTALLED: {
deliveryMethod: DeliveryMethod.Http,
callbackUrl: "/webhooks",
},
},
hooks: {
afterAuth: async ({ session }) => {
shopify.registerWebhooks({ session });
},
},
});
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024