PublishMessage webhook on Javascript SDK

Hello,
I'm trying to create a webhook sdk on Javascript but the problem is that there's no place in the Javascript sdk to set the ForwardWebhook to true like said in this particular message on the webhook setup:
Public and private messages will not trigger a webhook by default. Set the webflag "ForwardWebhook" to "true" in your client to trigger the webhook at "PathPublishMessage".

What is the other way around, besides making a HTTP POST request to the function itself?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Matchbox,

    Thank you for choosing Photon and for reporting this!

    This feature is still missing in JavaScript SDK, we will add it and get back to you.
    Sorry for the inconvenience.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited February 2018
    Hi @Matchbox,

    Download a modified version of the latest JS SDK (4.0.0.9) that has this parameter here.
    just use it as follows:
    chatClient.publishMessage(channelName, messageContent, true);
    chatClient.sendPrivateMessage(userId, messageContent, true);
  • Matchbox
    Matchbox
    edited February 2018
    Hello @JohnTube,

    Thank you for the update, but I may require another thing. Is it possible to set the Webhook call asynchronously? It's delaying the publishMessage action

    Thanks
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Matchbox,

    The call is async. We wait for the response to decide if we allow or cancel publishing the message depending or result.

    We are discussing options for "fire and forget" now.
  • I meant async to not wait for the response of the publishMessage webhook
  • JohnTube
    JohnTube ✭✭✭✭✭
    Yes I know.
    What I meant by "async" is that we do not pause the fiber and processing of other requests inside the channel.
  • Matchbox
    Matchbox
    edited February 2018
    Yes, but not letting the message being published slows the interaction... which turns the Webflag (for my case) inutile. Using an Ajax call to the publishMessage directly would be better, but not a good pactice. That's why I'm requesting some workaround.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Matchbox,

    Changing this could take a while, we need to think of a flexible way to allow both behaviours on demand and to make it hard to use this flexibility for "cheating".
    and it does not look like a priority now.
    If this is really important for you send an email to developer@photonengine.com and add link to this forum discussion. maybe you can convince someone to raise the priority of this task.
    No promises, no ETAs though.
    You're the first to ask such "good" thing.