@corti/dictation-web 0.1.19-rc.1 → 0.1.20-rc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +13 -12
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,14 +1,14 @@
1
- # Corti Dictation SDK
1
+ # Corti Dictation Web Component
2
2
 
3
3
  ## Overview
4
4
 
5
- The **Corti Dictation SDK** is a web component that enables real-time speech-to-text dictation using Corti's Dictation API. It provides a simple interface for capturing audio, streaming it to the API, and handling transcripts.
5
+ The **Corti Dictation Web Component** is a web component that enables real-time speech-to-text dictation using Corti's Dictation API. It provides a simple interface for capturing audio, streaming it to the API, and handling transcripts.
6
6
 
7
- > **Note:** OAuth 2.0 authentication is not handled by this SDK. The client must provide an API key or authorization token before using the component.
7
+ > **Note:** OAuth 2.0 authentication is not handled by this library. The client must provide an API key or authorization token before using the component.
8
8
 
9
9
  ## Installation
10
10
 
11
- Include the SDK in your project by importing the JavaScript module:
11
+ Include the Web Component in your project by importing the JavaScript module:
12
12
 
13
13
  ```html
14
14
  npm i @corti/dictation-web
@@ -17,7 +17,7 @@ npm i @corti/dictation-web
17
17
  Then import the module like so:
18
18
 
19
19
  ```js
20
- // Import the Corti Dictation SDK
20
+ // Import the Corti Dictation Web Component
21
21
  import '@corti/dictation-web';
22
22
  ```
23
23
 
@@ -43,7 +43,7 @@ Alternatively, use a CDN to start quickly (not recommended).
43
43
  <!DOCTYPE html>
44
44
  <html lang="en">
45
45
  <body>
46
- <corti-dictation></corti-dictation>
46
+ <corti-dictation id="dictation"></corti-dictation>
47
47
  <textarea
48
48
  id="transcript"
49
49
  placeholder="Transcript will appear here..."
@@ -51,9 +51,10 @@ Alternatively, use a CDN to start quickly (not recommended).
51
51
 
52
52
  <script>
53
53
  import '@corti/dictation-web';
54
- const dictation = document.getElementById('transcript');
55
- dictation.setAccessToken('YOUR_AUTH_TOKEN'); // Note: Never hardcode tokens
56
- // Listen for events
54
+ const dictationEl = document.getElementById('dictation');
55
+ dictationEl.addEventListener('ready', () => {
56
+ dictationEl.setAccessToken('YOUR_AUTH_TOKEN'); // Note: Never hardcode tokens
57
+ });
57
58
  dictationEl.addEventListener('transcript', e => {
58
59
  document.getElementById('transcript').value += e.detail.data.text + ' ';
59
60
  });
@@ -72,7 +73,7 @@ Alternatively, use a CDN to start quickly (not recommended).
72
73
  | `selectedDevice` | Object | The selected device used for recording (MediaDeviceInfo). |
73
74
  | `recordingState` | String | Current state of recording (`stopped`, `recording`, `initializing` and `stopping`, ). |
74
75
  | `dictationConfig` | Object | Configuration settings for dictation. |
75
- | `languagesSupported` | String[] | List of all language codes available for use on the SDK. |
76
+ | `languagesSupported` | String[] | List of all language codes available for use on the Web Component. |
76
77
  | `debug_displayAudio` | Boolean | Overrides any device selection and instead uses getDisplayMedia to stream system audio. Should only be used for debugging |
77
78
 
78
79
  ### Methods
@@ -96,7 +97,7 @@ Alternatively, use a CDN to start quickly (not recommended).
96
97
 
97
98
  ## Authentication
98
99
 
99
- This SDK does not handle OAuth 2.0 authentication. The client must provide an API key or access token as a string using `setAccessToken`.
100
+ This library does not handle OAuth 2.0 authentication. The client must provide an API key or access token as a string using `setAccessToken`.
100
101
 
101
102
  ## Usage Examples
102
103
 
@@ -110,7 +111,7 @@ The default UI is designed to be slotted into existing applications seamlessly,
110
111
 
111
112
  ## License
112
113
 
113
- This SDK is licensed under MIT.
114
+ This Web Component library is licensed under MIT.
114
115
 
115
116
  ## Support
116
117
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@corti/dictation-web",
3
3
  "description": "Web component for Corti Dictation",
4
4
  "author": "Corti ApS",
5
- "version": "0.1.19-rc.1",
5
+ "version": "0.1.20-rc",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",