@tavus/widget 0.0.1-beta.1
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/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +56 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tavus, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @tavus/widget
|
|
2
|
+
|
|
3
|
+
Tavus experience as a launcher `<tavus-widget>` custom element. Drop a single tag into any page and you get a floating launcher that opens a fully working Tavus conversation in a shadow DOM — no React, no build step required.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
### CDN (recommended for static pages)
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<script src="https://unpkg.com/@tavus/widget@beta"></script>
|
|
11
|
+
|
|
12
|
+
<tavus-widget deployment-id="YOUR_DEPLOYMENT_ID"></tavus-widget>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
For a pinned beta, use `https://unpkg.com/@tavus/widget@0.0.1-beta.1`.
|
|
16
|
+
|
|
17
|
+
### npm (bundler / framework apps)
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @tavus/widget@beta
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import "@tavus/widget";
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Importing the package registers the `<tavus-widget>` custom element as a side effect. After that you can use the tag anywhere in your app's markup — including JSX:
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
<tavus-widget deployment-id="YOUR_DEPLOYMENT_ID" />
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Attributes
|
|
34
|
+
|
|
35
|
+
| Attribute | Type | Description |
|
|
36
|
+
| ----------------- | ------ | ------------------------------------------------------------------------------- |
|
|
37
|
+
| `deployment-id` | string | The Tavus deployment ID. Fetches configuration from `/v2/deployments/:id/init`. |
|
|
38
|
+
| `override-config` | JSON | Optional JSON object that is deep-merged over the fetched config. |
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
interface TavusWidgetAttributes {
|
|
2
|
+
"deployment-id"?: string;
|
|
3
|
+
"override-config"?: string;
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementTagNameMap {
|
|
7
|
+
"tavus-widget": HTMLElement;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
declare module "preact" {
|
|
11
|
+
namespace JSX {
|
|
12
|
+
interface IntrinsicElements {
|
|
13
|
+
"tavus-widget": preact.JSX.HTMLAttributes<HTMLElement> & TavusWidgetAttributes;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
declare global {
|
|
18
|
+
namespace JSX {
|
|
19
|
+
interface IntrinsicElements {
|
|
20
|
+
"tavus-widget": TavusWidgetAttributes & {
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
declare module "react" {
|
|
27
|
+
namespace JSX {
|
|
28
|
+
interface IntrinsicElements {
|
|
29
|
+
"tavus-widget": React.HTMLAttributes<HTMLElement> & TavusWidgetAttributes;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {};
|