Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// Send email and PRO_PRODUCT_ID to check.php.
// check.php must get the list of all users from Paddle, then see if current user is among Pro users.
const userEmail = "";
const PRODUCT_ID = 11111; //See this ID in the Paddle dashboard.
const URL = '';
const data = {
email: userEmail,
const PARAMS = {
headers: {
"Accept": "application/json",
"Content-Type": "application/json; charset=UTF-8"
body: JSON.stringify(data),
method: 'POST'
fetch(URL, params)
.then(res => res.text())
.then(response => {
let res = JSON.parse(response);
//PHP script returns an object.
if(res.isPro === 'true'){
// It's a Pro user.
// It's a free-plan user.
.catch(error => console.error('Error:', error));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.