Adding Rocket Chat provider to Novu
So I took up an issue for adding rocket-chat provider to Novu, I did the installation steps and initialzed a new provider, but now I am kinda stucked here.
Issue: https://github.com/novuhq/novu/issues/4387#event-10548897288
I have installed
@rocket.chat/sdk
, i guess it is needed SDK, but it is for a Bot.
Rocket-chat is a chat provider, I read their documentation and can't figure out what credentials I have to add to the libs/shared/src/consts/providers/credentials/provider-credentials.ts
folder.
I have found this setup from the website https://developer.rocket.chat/bots/creating-your-own-bot-from-scratch/develop-a-rocket.chat-sdk-bot
It would be great @Zac Clifton or anyone here can help me with it because this is the first time I am taking up something like this, and I would like to learn more and finish it.
Sorry If I have done any mistakes ๐ขGitHub
[NV-2967] ๐ Feature: Add Rocket.chat Chat Provider ยท Issue #4387 ยท ...
๐ Feature description Use the Rocket.chat docs to create a new chat provider while following Novu's guide to a new provider ๐ค Why is this feature needed ? more options for the community โ๏ธ How ...
10 Replies
@Deveesh, you just advanced to level 1!
.
@Deveesh Sorry for the confusion, we currently do not support bots in Novu and I think I linked to the wrong documentation. My apoliges.
So with rocket.chat this would work the same as discord, the user would create a subscriber that has a webhook atached to them and we would send a message via that webhook.
Here is the documentation for how to send messages with webhooks and rocket.chat.
https://docs.rocket.chat/use-rocket.chat/workspace-administration/integrations#incoming-webhook-script
Let me know if you have any more questions, I would be happy to answer.
Integrations
Integrate tools and services to ease everyday workflows.
That helped a lot! Thank you...
Surely, I will get back if I am stuck again...
@Zac Clifton I checked the provider files for discord and slack
This is what I came up with (not sure whether it's correct)
This is what I came up with, I have a few questions here (sorry if they are too silly)
I found this in the discord documentation
I don't know the correct use, but it seems as some flag to wait till user sets all the parameters (Correct me if I am wrong)
Also, regarding the return id, I went through the documentation of rocket-chat and also I tried logging in and running it and I never found where and what thing is getting returned from it, in discord it is
id: response.data.id
while in slack it is id: response.headers['x-slack-req-id']
.
So here I am a little stuck ๐ฅฒ.
The above code maybe right also, but I never know it...So I do not think you need the search params on this call.
What is the raw responce when you call the webhook?
Oh I will remove it!
So till now I was doing wrong, I was pulling docker images and doing something weird, But after a little bit more digging I set up a server in rocket-chat and created a webhook from that documentation. This is the response I got from curl while testing the webhook.
Is the
x-instance-id
the correct id for the return statement?
So this is how to providers/rocket-chat/src/lib/rocket-chat.provider.ts
looks after the changes
@Zac Clifton sorry to disturb. Any suggestions regarding the above code?Hi @Deveesh
Apologies ๐๐ป
I choose rocket chat provider for demonstration purpose in today's office hours
https://www.youtube.com/watch?v=Y_2fBwFpOps
I will recommend you to choose any other issue
let me know if you find any other issue, I will assign to you
Ah shoot! It is fine... I will search for some other issues
@Deveesh, you just advanced to level 2!
I will watch that video, it will give me more idea about providers.
Most of issues seems to be occupied... I will try to find some issues and resolve it, or wait for some new ones