alexco888
Member
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.
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
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.
JavaScript:
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 protected]',
notify: true,
},
{
headers: {
Authorization: `Bearer ${process.env.CLERK_SECRET_KEY}`,
'Content-Type': 'application/json',
},
},
)
console.log(response.data)
} catch (error) {
console.error(error)
}
}
addIdentifierToAllowlist()
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