Hi guys,
Any idea on how I can trigger an action when I deploy my app to Live in Bubble?
My use case is to send a Slack notification to my team for each deployment in Bubble. Many thanks for your help
Hi guys,
Any idea on how I can trigger an action when I deploy my app to Live in Bubble?
My use case is to send a Slack notification to my team for each deployment in Bubble. Many thanks for your help
Hey,
As bubble do not have an out-of-the-box listener for this event exposed, You can try this given script on the page load to observe the bubble’s default notification when the app changes are deployed.
You can replace the logic of custom function set a state OR trigger a custom event using Javascript to Bubble.
To confirm if the script is running fine, you should see something like this in the console.
Here is the script:
function onElementVisible(entries, observer) {
entries.forEach(entry => {
if (entry.isIntersecting) {
// Add your custom logic here
console.log("Element with class 'bad-revision' is visible");
observer.unobserve(entry.target);
}
});
}
let observer = new IntersectionObserver(onElementVisible, {
root: null,
rootMargin: "0px",
threshold: 0.1
});
function observeElements() {
let targetElements = document.querySelectorAll(".bad-revision:not(.observed)");
targetElements.forEach(element => {
observer.observe(element);
element.classList.add("observed"); // Mark as observed
});
}
// Initial observation
observeElements();
// Mutation observer for dynamically added elements
const mutationObserver = new MutationObserver(observeElements);
mutationObserver.observe(document.body, { childList: true, subtree: true });
Let me know if this works for you.
Happy to connect for further discussion.
This topic was automatically closed after 70 days. New replies are no longer allowed.