Created
September 25, 2023 11:34
-
-
Save Snakeyyy/2ae2ba6e4edcf1cbf0b8b2f92e66dc3a to your computer and use it in GitHub Desktop.
PartnerJam - example of notifying PartnerJam about successfull installation of the app - NodeJS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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