I am working on a plugin that will be loaded via script tag to the client site. I want to integrate this with Sentry so that it only alerts me about the plugin erros and not the host page errors. I have loaded the plugin to the Wix site and it keeps alerting me about the wix issues. I have tried filtering but checking the frame filename to match the plugin src from the script tag e.g. https://myplugin.solutions.com/ but it still send me wix errors.
beforeSend(event) { const pathFilter = PLUGIN_LOADER_URL; const exception = event?.exception; if (exception) { const values = exception?.values || []; for (const value of values) { const frames = value.stacktrace?.frames || []; for (const frame of frames) { // Check if the filename exists and includes the required path filter if (frame.filename && frame.filename.includes(pathFilter)) { return event; } } } } return null; },