Build with Watson Apps

Expand all | Collapse all

Using Watson text-to-speech service from the front-end react app running in the browser

  • 1.  Using Watson text-to-speech service from the front-end react app running in the browser

    Posted 3 days ago
    If I understand correctly, although one has to authenticate with the API key from the backend, the backend can obtain an IAM bearer token and send it to the front-end (e.g. a react app running in the browser), so that the latter can make requests to the Watson text-to-speech service directly. Is this understanding correct? If so, does there exist a minimalistic example for this setup that I can use?

    ------------------------------
    Meir Goldenberg
    ------------------------------


  • 2.  RE: Using Watson text-to-speech service from the front-end react app running in the browser

    Posted 2 days ago
    Hi Meir,

    i think you can work out your backend as you want in the sense that you essentially need to authenticate to the STT api using provided credentials on your backend.

    So i i wou do it like that whe. You authenticated your user on your front end, depending on his permissions you set for him, you can encode his permissions on a token send back to him on the front.

    Use thay token along any request to verify his permission or simply use his id encoded in the tokwn to do this. Anyways, once he is authorised to use the API your BE can work this logic out and allow usage of the STT or TTS...

    Hope that helps.

    David



    ------------------------------
    David Tin
    ------------------------------



  • 3.  RE: Using Watson text-to-speech service from the front-end react app running in the browser

    Posted 2 days ago
    Thank you for the clarification. I did this, but for some reason the resulting MP3 does not play. Could you please take a look at the linked question I posted about this?

    ------------------------------
    Meir Goldenberg
    ------------------------------