## Every time, when already existing project saves or opened, or a new project creates, the planner sends the ID of this project to the client
Example of how to get projectId from Roomtodo planner:
<iframe
frameborder="0"
id="iframe"
src="https://example.com/planner/matconfig">
</iframe>
<script>
window.addEventListener("message", messageListener);
function messageListener(e) {
try {
const dataObj = JSON.parse(e.data);
if (dataObj.action === "set_project") {
let projectId = data.projectId;
}
} catch (error) {
console.error("Error parse JSON string!");
}
}
</script>
Also JSON config for client's site has to contains 'enable_set_project': true: