The developer has been notified of this issue.
NODE js problem
-
i m running script on visual studio works fine, i have problem addin it in BAS node. i add node-fetch and still not working
import fetch from 'node-fetch'; // Replace these values with your actual page access token and page ID const pageAccessToken = 'OWZBLIV1BjDW9'; const pageId = '23713142828178'; const message = 'This is a test post from blabla'; // Facebook Graph API endpoint for posting to a page's feed const url = `https://graph.facebook.com/${pageId}/feed`; // Data to be sent in the POST request const data = { message: message, access_token: pageAccessToken }; // Function to post to Facebook async function postToFacebook() { try { const response = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data) }); const result = await response.json(); if (result.id) { console.log('Post created successfully!', result); } else { console.error('Error creating post:', result); } } catch (error) { console.error('Error:', error); } } // Call the function to post to Facebook postToFacebook();any advices ?
-
@mak0ni said in NODE js problem:
import fetch from 'node-fetchconst {default: fetch } = await import("node-fetch")