import wixData from 'wix-data'; // Import Wix Data module $w.onReady(function () { // Reka AI PDF and Image Reader API endpoints const pdfReaderAPI = 'YOUR_PDF_READER_API_ENDPOINT'; const imageReaderAPI = 'YOUR_IMAGE_READER_API_ENDPOINT'; // Function to call Reka AI PDF Reader API function readPDF(pdfUrl) { return fetch(pdfReaderAPI, { method: 'POST', body: JSON.stringify({ pdfUrl }), headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY' // Replace with your API key } }) .then(response => response.json()) .catch(error => console.error('Error calling Reka AI PDF Reader API:', error)); } // Function to call Reka AI Image Reader API function readImage(imageUrl) { return fetch(imageReaderAPI, { method: 'POST', body: JSON.stringify({ imageUrl }), headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY' // Replace with your API key } }) .then(response => response.json()) .catch(error => console.error('Error calling Reka AI Image Reader API:', error)); } // Event handler for PDF file upload $w('#pdfUploadButton').onChange((event) => { const pdfUrl = event.target.value; readPDF(pdfUrl) .then(response => { // Process response from Reka AI PDF Reader API console.log('Reka AI PDF Reader Response:', response); // Display results on your Wix site as needed }); }); // Event handler for image upload $w('#imageUploadButton').onChange((event) => { const imageUrl = event.target.value; readImage(imageUrl) .then(response => { // Process response from Reka AI Image Reader API console.log('Reka AI Image Reader Response:', response); // Display results on your Wix site as needed }); }); }); Site Aquisition Specialist | parcels