@@ -3,45 +3,43 @@ import defaultAssistant from "./assistant";
3
3
import { createButtonElement } from "./button" ;
4
4
import { defaultListeners } from "./listeners" ;
5
5
6
- const defaultButtonConfig = {
7
- position : "bottom" ,
8
- offset : "40px" ,
9
- width : "50px" ,
10
- height : "50px" ,
11
- idle : {
12
- color : `rgb(93, 254, 202)` ,
13
- type : "pill" ,
14
- title : "Have a quick question?" ,
15
- subtitle : "Click here to talk with our AI assistant" ,
16
- icon : `` ,
17
- } ,
18
- loading : {
19
- color : `rgb(255, 255, 255)` ,
20
- type : "pill" ,
21
- title : "Connecting..." ,
22
- subtitle : "Please wait" ,
23
- icon : `` ,
24
- } ,
25
- active : {
26
- color : `rgb(255, 255, 255)` ,
27
- type : "pill" ,
28
- title : "Call is in progress..." ,
29
- subtitle : "Click again to end the call." ,
30
- icon : `` ,
31
- } ,
32
- } ;
33
-
34
6
const runSDK = ( {
35
7
apiKey = "" ,
36
8
assistant = defaultAssistant ( ) ,
37
9
38
- button : defaultButtonConfig ,
10
+ buttonConfig = {
11
+ position : "bottom" ,
12
+ offset : "40px" ,
13
+ width : "50px" ,
14
+ height : "50px" ,
15
+ idle : {
16
+ color : `rgb(93, 254, 202)` ,
17
+ type : "pill" ,
18
+ title : "Have a quick question?" ,
19
+ subtitle : "Click here to talk with our AI assistant" ,
20
+ icon : `` ,
21
+ } ,
22
+ loading : {
23
+ color : `rgb(255, 255, 255)` ,
24
+ type : "pill" ,
25
+ title : "Connecting..." ,
26
+ subtitle : "Please wait" ,
27
+ icon : `` ,
28
+ } ,
29
+ active : {
30
+ color : `rgb(255, 255, 255)` ,
31
+ type : "pill" ,
32
+ title : "Call is in progress..." ,
33
+ subtitle : "Click again to end the call." ,
34
+ icon : `` ,
35
+ } ,
36
+ } ,
39
37
// position = "bottom",
40
38
// color = `rgb(93, 254, 202)`,
41
39
// offset = "40px",
42
40
} ) => {
43
41
const vapi = new Vapi ( apiKey ) ;
44
- const button = createButtonElement ( defaultButtonConfig ) ;
42
+ const button = createButtonElement ( buttonConfig ) ;
45
43
46
44
defaultListeners ( vapi , button , color , assistant ) ;
47
45
0 commit comments