Essential Functions
Essential functions to implement the basic functionality of Invox Dictation SDK.
Init
| Function | Description | Parameters | Returns |
|---|---|---|---|
| INVOX.init(config) | Initializes global SDK connection context used by Login and related services. | Object | void |
Initialize SDK configuration before calling Login.
Parameters:
config: Object with the following properties. All values are provided by Invox Medical for your integration; do not invent your own.
organizationId:String— required. Identifier of your organization in Invox Medical. Use the exact value provided by Invox Medical.appId:String— optional. Identifier of the application that integrates the SDK. Provide it when Invox Medical has issued application credentials for your integration.apiKey:String— optional. API key associated withappId. Provide it together withappId.transcriptionServiceUrl:String— optional. URL of the Remote Dictation Service (speech recognition). Defaults towss://debug.invoxmedical.com, which is a debug environment. Provide a value whenever you connect to any other environment (for example, UAT or production) or to a dedicated Dictation Service; use the URL provided by Invox Medical.adminServiceUrl:String— optional. URL of the Corporate Server used for authentication and user data. Defaults tohttps://debug.invoxmedical.com/INVOX/, which is a debug environment. Provide a value whenever you connect to any other environment (for example, UAT or production) or to your organization's own Corporate Server; use the URL provided by Invox Medical.
The default URLs point to a debug environment. Production integrations must always set
transcriptionServiceUrl and adminServiceUrl.import INVOX, { InitializationConfigType } from "@invox-medical-npm/invox-dictation";
const config: InitializationConfigType = {
organizationId: "provided_organization_id",
appId: "provided_app_id",
apiKey: "provided_api_key",
transcriptionServiceUrl: "provided_transcription_service_url",
adminServiceUrl: "provided_admin_service_url",
};
INVOX.init(config);
Login
| Function | Description | Parameters | Returns |
|---|---|---|---|
| INVOX.Login(credentials) | Starts connection with Invox Dictation Service. | Object | Promise<void> |
Allows you to login a user into Invox Dictation SDK using a username and password. This function also establishes communication with the Dictation Service.
Before calling Login, initialize the SDK connection context with INVOX.init(...).
Parameters:
credentials:Objectuser:String— the user's login name.password:String— the user's password.
Returns: Promise<void> — The promise indicates successful connection, not successful login.
import INVOX, { InitializationConfigType, LoginCredentialsType } from "@invox-medical-npm/invox-dictation";
const config: InitializationConfigType = {
organizationId: "provided_organization_id",
};
INVOX.init(config);
const credentials = {
user: "example",
password: "example",
};
const typedCredentials: LoginCredentialsType = credentials;
try {
await INVOX.Login(typedCredentials);
} catch (e) {
console.error(e);
}
Logout
| Function | Description | Parameters | Returns |
|---|---|---|---|
| INVOX.Logout() | Ends the current Invox Dictation session. | — | Promise<void> |
try {
await INVOX.Logout();
} catch (e) {
console.error(e);
}
SwitchDictation
| Function | Description | Parameters | Returns |
|---|---|---|---|
| INVOX.SwitchDictation() | Starts or stops the dictation depending on its internal state. | — | void |
INVOX.SwitchDictation();
SetTextWriter
| Function | Description | Parameters | Returns |
|---|---|---|---|
| INVOX.SetTextWriter(writer) | Sets the TextWriter implementation to use for writing operations. | Object | void |
Parameters:
writer:Object— an instance of a TextWriter. UseINVOX.TextAreaTextWriterfor standard HTML TextAreas, or a custom writer for other editors.
// For standard HTML TextArea
INVOX.SetTextWriter(INVOX.TextAreaTextWriter);
// For a custom writer
INVOX.SetTextWriter(myCustomWriter);
SetWriterTarget
| Function | Description | Parameters | Returns |
|---|---|---|---|
| INVOX.SetWriterTarget(target) | Sets the target editor element where dictation results will be written. | Element | void |
const textareaElement = document.getElementById("invox-textarea-1");
INVOX.SetWriterTarget(textareaElement);
GetWriterTarget
| Function | Description | Parameters | Returns |
|---|---|---|---|
| INVOX.GetWriterTarget() | Returns the current writer target element. | — | Element |
const currentTarget = INVOX.GetWriterTarget();
ShowHelp
| Function | Description | Parameters | Returns |
|---|---|---|---|
| INVOX.ShowHelp() | Opens the Invox Dictation help viewer. | — | void |
INVOX.ShowHelp();