
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@speechmatics/flow-client
Advanced tools
Official Javascript client for the Speechmatics Flow API.
npm i @speechmatics/flow-client
[!WARNING]
For React Native, make sure to install theevent-target-polyfill
package, or any other polyfill for theEventTarget
class
The two main exports from this package are the FlowClient
class, and the fetchPersonas
function.
The FlowClient
class is an EventTarget
. You can listen for incoming events including audio and transcription messages:
import { FlowClient, AgentAudioEvent } from "@speechmatics/flow-client";
const flowClient = new FlowClient('wss://flow.api.speechmatics.com', { appId: "example" });
function onAgentAudio(audio: AgentAudioEvent) {
// audio.data is PCM16_SLE data. How you play this depends on your environment
myAudioPlayFunction(audio.data)
}
flowClient.addEventListener("agentAudio", onAgentAudio);
flowClient.startConversation(YOUR_JWT, {
config: {
template_id: "flow-service-assistant-amelia",
template_variables: {},
},
// Optional, this is the default
audio_format: {
type: 'raw',
encoding: 'pcm_s16le',
sample_rate: 16000,
},
});
// PCM audio can be sent to the client (either f32 or int16 depending on the audio_format defined above)
function onPCMAudio(audio: Int16Array) {
flowClient.sendAudio(audio);
}
function onSessionEnd() {
// Ends conversation and closes websocket
flowClient.endConversation();
// Event listeners can also be removed like so
flowClient.removeEventListener("agentAudio", onAgentAudio);
}
See the package @speechmatics/flow-client-react
for integration with React based projects.
FAQs
Javascript client for the Speechmatics Flow API
The npm package @speechmatics/flow-client receives a total of 403 weekly downloads. As such, @speechmatics/flow-client popularity was classified as not popular.
We found that @speechmatics/flow-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.