@layercode/js-sdk 2.8.3 → 2.8.4
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.
- package/README.md +15 -5
- package/dist/layercode-js-sdk.esm.js +281 -247
- package/dist/layercode-js-sdk.esm.js.map +1 -1
- package/dist/layercode-js-sdk.min.js +281 -247
- package/dist/layercode-js-sdk.min.js.map +1 -1
- package/dist/types/index.d.ts +13 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,13 +8,23 @@ A JavaScript SDK for integrating Layercode voice agents into web applications.
|
|
|
8
8
|
npm install @layercode/js-sdk
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Or load it
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
## Or load it another way:
|
|
12
|
+
|
|
13
|
+
- Module import from your own hosted ESM (current project):
|
|
14
|
+
`const { default: LayercodeClient, listAudioInputDevices, watchAudioInputDevices } = await import("/static/layercode-js-sdk.esm.js");`
|
|
15
|
+
- Module import from npm inside a bundler:
|
|
16
|
+
`import LayercodeClient, { listAudioInputDevices, watchAudioInputDevices } from "@layercode/js-sdk";`
|
|
17
|
+
- Module import from CDN ESM:
|
|
18
|
+
`import LayercodeClient, { listAudioInputDevices, watchAudioInputDevices } from "https://cdn.jsdelivr.net/npm/@layercode/js-sdk/dist/layercode-js-sdk.esm.js";`
|
|
19
|
+
- Global access via UMD <script> (no modules):
|
|
20
|
+
```js
|
|
21
|
+
<script src="https://cdn.jsdelivr.net/npm/@layercode/js-sdk/dist/layercode-js-sdk.umd.js"></script>
|
|
22
|
+
<script>
|
|
23
|
+
const { LayercodeClient, listAudioInputDevices, watchAudioInputDevices } = window.Layercode;
|
|
24
|
+
</script>
|
|
15
25
|
```
|
|
16
26
|
|
|
17
|
-
> Device helpers require a secure context (https/localhost)
|
|
27
|
+
> Device helpers require a secure context (https/localhost).
|
|
18
28
|
|
|
19
29
|
## Device helpers
|
|
20
30
|
|