Install the client library using npm:
npm i latam-api
{
"environment": "development",
"client_credentials": {
"clientId": "abc",
"clientSecret": "123",
"accessTokenUri": "https://test.api.latam-pass.latam.com/oauth/token",
"scopes": ["member-create", "member-show"]
}
}
import Latam from "latam-api";
const latam = new Latam(credentials);
try {
const member = await latam.member();
const response = await member.getMember("PROGRAM-ID", "DNIPE", "46880221");
if (!Array.isArray(response) || response.length === 0) return false;
console.log("Member", response);
} catch (err) {
console.log("Error", err);
}