Hello,
I am making a chat plugin for PeerTube and one of my features is to allow any user to authenticate to the chat with an external Fediverse account. I achieve this by taking the same approach as Owncast. That is by having the server sending an OTP code with ActivityPub DM to the user that wants to authenticate, and then validate this code.
My current issue is that I struggle to find a way for the server to send this ActivityPub Note to the user that requests it. Is there a function or API call that I can use to send this DM?
I could send the message manually through a normal POST but ActivityPub requires the messages to be signed. So for that to work I would have to get the servers private key that correlate to the server actor and sign the message. Is this possible to get through code in a plugin?