How can I integrate Pabbly Subscription Billing + Webhooks to my Next.js project?
Status: Closed · Asked by El Café de los Sentidos S de RL de CV on · 0 views
Hi! I hopy you are great :)
I would like to be able to update an allow-list for my Next.js Application with Clerk.
I share a code that allows me to do it manually with node.js:
I only need to change the identifier and I automatically add that email to my Clerk's allow-list.
const axios = require('axios')
require('dotenv').config({ path: '.env.local' })async function addIdentifierToAllowlist() {
try {
const response = await axios.post(
'https://api.clerk.com/v1/allowlist_identifiers',
{
identifier: '[email hidden]',
notify: true,
},
{
headers: {
Authorization: `Bearer ${process.env.CLERK_SECRET_KEY}`,
'Content-Type': 'application/json',
},
},
)console.log(response.data)
} catch (error) {
console.error(error)
}
}
addIdentifierToAllowlist()
I want to be able to automize this process (right now Pabbly Connect does not support Clerk (https://clerk.com/) so I would need to do it with code (I am using node.js inside my Next.js project).
How should I get the emails from a specific product from Pabbly Subscription Billing each time there is a successful payment? And more, to be able via webhooks to read if the user is still active or if he missed a payment, to him to not have access to my app (and be removed from my allow-list).
Thank you very much for your attention :)
Hello @alexco888
To configure the above mentioned requirement, you can use Pabbly Connect. In Pabbly Connect, you have the option to call the API using trigger known as the Custom API by Pabbly. After calling the API, you can pass the required details as per your specifications and achieve your use-case accordingly.
Additionally, to retrieve customer details such as email and subscription-related information, like failed payments or cancelled subscriptions, you can use the webhook option available in Pabbly Subscription Billing. There are multiple webhook triggers available, allowing you to use these triggers to obtain customer, subscription, or payment details. For a more details, please refer to the screenshot below.
I hope this addresses your query. If you have any further concerns or questions, please do not hesitate to contact us again.
