N
Novuβ€’9mo ago
Pawan Jain

How to test embed changes in local machine

12 Replies
Pawan Jain
Pawan Jainβ€’9mo ago
Create a temporary index.html file in libs/embed directory in parallel to package.json
Pawan Jain
Pawan Jainβ€’9mo ago
Write this code into that file
<nav>
<div id="notification-bell">
<i class="fa fa-bell"></i>
<span id="unseen-badge"></span>
</div>
</nav>


<script>
(function (n, o, t, i, f) {
n[i] = {};
var m = ["init", "on"];
n[i]._c = [];
m.forEach(
(me) =>
(n[i][me] = function () {
n[i]._c.push([me, arguments]);
})
);
var elt = o.createElement(f);
elt.type = "text/javascript";
elt.async = true;
elt.src = t;
var before = o.getElementsByTagName(f)[0];
before.parentNode.insertBefore(elt, before);
})(
window,
document,
"./dist/embed.umd.min.js",
"novu",
"script"
);

novu.init(
"APPLICATION_IDENTIFIER",
{
unseenBadgeSelector: "#unseen-badge",
bellSelector: "#notification-bell",
},
{
subscriberId: "SUBSCRIBER_ID",
email: "SUBSCRIBER_EMAIL",
first_name: "SUBSCRIBER_FIRST_NAME",
last_name: "SUBSCRIBER_LAST_NAME",
}
);
</script>
<nav>
<div id="notification-bell">
<i class="fa fa-bell"></i>
<span id="unseen-badge"></span>
</div>
</nav>


<script>
(function (n, o, t, i, f) {
n[i] = {};
var m = ["init", "on"];
n[i]._c = [];
m.forEach(
(me) =>
(n[i][me] = function () {
n[i]._c.push([me, arguments]);
})
);
var elt = o.createElement(f);
elt.type = "text/javascript";
elt.async = true;
elt.src = t;
var before = o.getElementsByTagName(f)[0];
before.parentNode.insertBefore(elt, before);
})(
window,
document,
"./dist/embed.umd.min.js",
"novu",
"script"
);

novu.init(
"APPLICATION_IDENTIFIER",
{
unseenBadgeSelector: "#unseen-badge",
bellSelector: "#notification-bell",
},
{
subscriberId: "SUBSCRIBER_ID",
email: "SUBSCRIBER_EMAIL",
first_name: "SUBSCRIBER_FIRST_NAME",
last_name: "SUBSCRIBER_LAST_NAME",
}
);
</script>
taken from here:- https://docs.novu.co/notification-center/client/iframe
Pawan Jain
Pawan Jainβ€’9mo ago
I replaced https://embed.novu.co/embed.umd.min.js with ./dist/embed.umd.min.js so that it takes up local file let me know if it works
Shruti
Shrutiβ€’9mo ago
Hello @Pawan Jain I also tried doing the same, but it was not working ... I am using this command to see the changes, npm run start:widget is that correct ? I also tried using npm run start with web and widget option, and tried visiting localhost:4500 but nothing was there
Novu_Bot
Novu_Botβ€’9mo ago
@Shruti, you just advanced to level 1!
Shruti
Shrutiβ€’9mo ago
nvm, I was able to figure it out! I was looking at wrong places. Here is the PR - https://github.com/novuhq/novu/pull/4688 Thank you @Pawan Jain
User15
User15β€’9mo ago
Hi this is my first time running the project. Its runs on http://localhost:4200/auth/login .After this i changed the env to production under api .env .But i cannot move past this page.What am i missing?
User15
User15β€’9mo ago
No description
User15
User15β€’9mo ago
@Emil
empe
empeβ€’9mo ago
Can you please open a separate ticket ("Post" here on the support channel) for it? Please make sure to include screenshots of what you see beside the console and what you're trying to do in more detail. One on foot; I suspect you try to log in using Github Auth? If that is the case, GitHub auth doesn't work on self-hosted version, but you can log in using an email and a password. Regardless, please open another post so we could keep the proper context πŸ™‚
User15
User15β€’9mo ago
okay il do that but im trying to login with password and email (created an account on prod first)
empe
empeβ€’9mo ago
Send a link here for the new post once your have it πŸ™‚