Skip to content

Instantly share code, notes, and snippets.

@Snakeyyy
Created September 25, 2023 11:34
Show Gist options
  • Save Snakeyyy/2ae2ba6e4edcf1cbf0b8b2f92e66dc3a to your computer and use it in GitHub Desktop.
Save Snakeyyy/2ae2ba6e4edcf1cbf0b8b2f92e66dc3a to your computer and use it in GitHub Desktop.
PartnerJam - example of notifying PartnerJam about successfull installation of the app - NodeJS
const axios = require("axios");
async function installAppView(request) {
// do your logic
const shop = store_shop_data(request);
const appSecret = "<secret>" // obtain this secret in PartnerJam Dashboard in application setup
const token = request.cookies.partner_jam_token;
await axios.post(
"https://be-app.partnerjam.com/webhooks/installation-confirm/",
{
token: token,
shopify_id: shop.shopify_id,
shop_name: shop.shop_name,
myshopify_domain: shop.myshopify_domain,
pricing_plan: shop.plan,
secret: appSecret,
test: false, // set true for dry run (only for testing purposes)
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment