I have been through all of the docs and help topcis but I just do not get how zapier expects code in a java script zap to provide data.
Why is the output undefined? I tried to set output or use the callback (which i prefer). Nothing works :(
(function() {
const load = async () => {
const auth = "foo";
const url = `bar`;
const headers = {
"Authorization": `Basic ${auth}`,
"Content-Type": "application/json",
"X-Crisp-Tier": "plugin",
};
const options = {
method: "GET",
headers
};
const response = await fetch(url, options);
return await response.json();
}
load().then((response) => {
callback(null, response)
output = response
})
})()