Content Deep Dive
Asynchronous Logic to Write a Vue 3 and Deepgram Captions Component
Blog post from Deepgram
Post Details
Company
Date Published
Author
Sandra Rodgers
Word Count
2,945
Language
English
Hacker News Points
-
Summary
In this tutorial, Sandra Rodgers demonstrates how to use Vue 3 composables to power a text-captions component that integrates with Deepgram's speech-to-text API. The post covers using async and await to write a composable that fetches a temporary API key from Deepgram, using Vue 3's watch method to react to data that is updating in real-time as Deepgram sends a text transcription back through a browser WebSocket, and writing logic that is sensitive to the order things occur - i.e., asynchronous logic that flows between the component and the composable. The tutorial assumes some knowledge of Vue 3, in particular Vue composables.