Realtime Voice to text translation not working... on Web #22
-
|
Hi all, I know I am missing something here. I have setup a index.html with JavaScript and a server.js to interact with Speechmatics, and I even have a lovely script that will launch it all and setup the environment... But it says I do not have permissions... Please note I have put an example API, you can enter your own... Any help would be great! Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Hi Greg, thanks for reaching out and apologies for the delayed response. I've checked out your code, and I think the issue is the way you're calling async start(
jwt: string,
config: RealtimeTranscriptionConfig,
): Promise<RecognitionStarted> {Rather than sending your Speechmatics API key to the browser from your Express server (which could be a security risk), we recommend you use the We're planning on adding a vanilla JS example similar to the one you provided. Thank you for sharing that. I'll keep you posted here when that's available. In the meantime, have a look at the auth package and let us know if you encounter any issues. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks! I was able to fix it.
Thanks
Greg
… On Feb 10, 2025, at 5:59 AM, Matt Nemitz ***@***.***> wrote:
Hi Greg, thanks for reaching out and apologies for the delayed response.
I've checked out your code, and I think the issue is the way you're calling client.start(). The first argument to that function should be a JWT (see snippet from the source code below):
async start(
jwt: string,
config: RealtimeTranscriptionConfig,
): Promise<RecognitionStarted> {
Rather than sending your Speechmatics API key to the browser from your Express server (which could be a security risk), we recommend you use the @speechmatics/auth <https://docs.speechmatics.com/sdk/javascript-authentication> package server-side to generate a temporary key <https://docs.speechmatics.com/introduction/authentication#temporary-keys> which can be read safely by the client, and passed to the start() method.
We're planning on adding a vanilla JS example similar to the one you provided. Thank you for sharing that.
I'll keep you posted here when that's available. In the meantime, have a look at the auth package and let us know if you encounter any issues.
—
Reply to this email directly, view it on GitHub <#22 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/A2CLSYWQAXT7MKNYI4YZJ2L2PCIARAVCNFSM6AAAAABUSKB3QKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMJRG44TMMA>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
Hi Greg, thanks for reaching out and apologies for the delayed response.
I've checked out your code, and I think the issue is the way you're calling
client.start(). The first argument to that function should be a JWT (see snippet from the source code below):Rather than sending your Speechmatics API key to the browser from your Express server (which could be a security risk), we recommend you use the
@speechmatics/authpackage server-side to generate a temporary key which can be read safely by the client, and passed to thestart()method.We're planning on adding a vanilla JS exampl…