You can get the project id from the context. Then check if the received id matches the expected one.
$(document).ready(function () {
const projectId = uiscripts.context.project.id;
if (projectId == '1') {
// something
}