Hosted Experience
Configuration Options
46min
constructor the uneeq class is instantiated with the following constructor constructor(options); parameters options (object) configuration options for initializing the uneeq instance options the configuration options you may pass when initializing the uneeq class allowresumesession (optional) a boolean indicating whether to automatically resume a previous session if one exists if set to true, the system will attempt to restore the last active session based on stored session data within 24 hours session data is stored per personaid, meaning each persona maintains its own session history if false or omitted, a new session will always be created default value is false allowresumesession true autostart (optional) a boolean indicating whether to automatically start the session this option will configure your session to start automatically on page load, without calling startsession() default value is false autostart false cameraanchorhorizontal (optional) a string defining the initial camera anchor horizontal position when the session starts values left right center cameraanchorhorizontal "right" cameraanchordistance (optional) a string defining the initial camera anchor distance (zoom) when the session starts values close up loose close up tight medium shot medium shot medium full shot full shot cameraanchordistance "close up" captionsposition (optional) a string defining where the closed captions will be positioned default value is 'bottom left' values bottom left bottom right bottom top left top right top connectionurl (required) a string url for the connection endpoint connectionurl "https //api uneeq io" ctathumbnailurl (optional) a string url to override the call to action thumbnail image the image provided by the url should be a square 140px jpg png or gif ctathumbnailurl "https //cdn your domain com/image1" custommetadata (optional) json data to be passed with all chat prompt or voice prompts note, this value can be overwritten at run time using setcustompromptmetadata() data set via custommetadata will be sent to your conversation platform, and may be used when generating responses custommetadata {"name" "john"} customstyles (optional) a string defining custom css that will be applied to the hosted experience frame for example, this may be used to change the color of a button within the hosted experience frame custom styles docid\ btz610dnb75lewwxzsmrq for more info customstyles `h1 { font size 150%; }` displaycalltoaction (optional) a boolean indicating whether to display a call to action default value is true displaycalltoaction false enablemicrophone (optional) a boolean indicating whether the microphone permission is requested as soon as the session starts default value is false enablemicrophone true enablevad (optional) a boolean indicating whether to enable voice activity detection (vad) vad allows the user to speak without pushing a button to start/stop recording setting this value to false will require the user to push to talk default value is true enablevad false initloadhandler (optional) a boolean indicating whether the digital human frame should be initialised on page load when this value is true the digital human frame will be initialized when the page is loaded (via a page load event handler) when this value is false , then the digital human frame will not be added to the page on page load if you set this value to false then you will need to call uneeq init() yourself when you want the digital human frame to be loaded this is desirable in some situations when you want to delay or prevent loading the digital human script until some data has been retrieved, or action taken on the page default value is true initloadhandler false languagestrings (optional) the languagestrings property can be defined to update any of the text displayed within the hosted experience interface language strings object should contain values corresponding to iso 639 1 languages, e g en, es, ja, etc within each language code value, provide an object containing the key of the value you want to update additionally a specific locale/region may be provided for more precise language targetting, e g en us, en gb, de de, pt br when a user loads the digital human experience their browser will provide a list of their preferred languages (an array in preference order) hosted experience will iteratively search the list of languagestrings you provide to find a match for the key based on the users preferred languages set in their browser more information on how the browser detects the preferred language can be found here if a language code is not provided then the 'default' value will be used if no 'default' configuration is specified by you, then the hosted experience base values will be used a complete list of languagestring keys may be found here language strings docid\ hdhojzauh i7iuffcjuay languagestrings { 	es { 	 calltoactiontext "¡hola! haga clic aquí para iniciar una conversación e", 	 textinputplaceholder "escriba aquí ", 	}, 	ja { 	 calltoactiontext "やあ!会話を始めるにはここをクリックしてください。", 	 textinputplaceholder "ここに入力 ", 	}, 	"de de" { 	 calltoactiontext "hi! klicken sie hier, um ein gespräch zu beginnen ", 	 textinputplaceholder "geben sie hier ein ", 	}, 	default { 	 calltoactiontext "hi! click here to start a conversation ", 	 textinputplaceholder "type here ", 	}, } layoutmode (optional) a string defining the layout mode overlay value overlay displays the digital human in a small overlaid window in the bottom right of the users view this view is best when the user needs to continue viewing the website they are on full screen value fullscreen displays the digital human in a view that covers the users entire view the user will not be able to view or interact with the hosting website this view is best for an emersive digital human experience contained displays the digital human inside an html div container element that the client adds to their page and controls to use this layout mode the client must have a div element on the page with the id uneeqcontainedlayout the digital human will be rendered inside this container, while allowing the client to restyle the container for example the client could move the element, resize, or hide the digital human according to the context note the container element cannot be removed from the dom without ending the session layoutmode "overlay" loglevel (optional) a string defining the desired log level selecting a lower log level will include all log levels above it for example, using 'info' will also include log levels above it, such as 'warn', 'error' and 'fatal' to have the minimal amount of logging from hosted experience, you should use 'error' values error warn info debug trace loglevel "warn" personaid (required) the id of the digital human to be started this value can be copied from the uneeq configuration portal > digital human page personaid "323d5c36 e01c 4c0d 9ef5 2c00de4aa166" rendercontent (optional) a boolean indicating whether to render html content within the digital human frame if this option is set to false, you may choose to catch the html content message in the client implementation and render content within your own view rendercontent false showclosedcaptions (optional) a boolean indicating whether to show closed captions within the view when disabled, the client may catch the event and render their close the default value is true showclosedcaptions false showuserinputinterface (optional) a boolean indicating whether to show the user input interface, which includes the text input element used for typing text messages, and the microphone mute button when disabled, you may prefer to implement your own input interface outside of the uneeq frame showuserinputinterface true speechrecognitionhintphrases (optional) a comma separated string of hint phrases that should be used to hint the speech recognition system about words to expect if you provide hint phrases here, then they are more likely to be detected in the speech recognition system speechrecognitionhintphrases "uneeq,digital humans" speechrecognitionhintphrasesboost (optional) an integer between 0 and 20 that can be used to boost the likelyhood of hint phrase words being detected in speech speechrecognitionhintphrasesboost 10 speechrecognitionlocales (optional) this option specifies up to four locales that the digital human should understand a person speaking (speech recognition) the locales are specified in the bcp 47 format e g "en us" the first locale is considered the primary locale locales should be separated with a colon speechrecognitionlocales en us\ en gb\ en au welcomeprompt (optional) the prompt that will be sent to your conversation (llm) system when the session starts default value is "hello" note this value is not what will be spoken to the user when the session starts, it is the prompt (question) that is sent to your language model from the user welcomeprompt "hi, can you welcome me and see if i need any help " complete example let uneeqoptions = { connectionurl "https //api uneeq io", personaid "323d5c36 e01c 4c0d 9ef5 2c00de4aa166", displaycalltoaction true, rendercontent true, ctathumbnailurl "https //your cta image com", customstyles "/ define your own styles /", mobileviewwidthbreakpoint 900, layoutmode "fullscreen", cameraanchorhorizontal "center", cameraanchordistance "loose close up", loglevel "info", enablemicrophone false, showuserinputinterface true, enablevad true, enableinterruptbyspeech false, autostart false, containedautolayout true, showclosedcaptions true, languagestrings { es { calltoactiontext "¡hola! haga clic aquí para iniciar una conversación e", textinputplaceholder "escriba aquí ", }, ja { calltoactiontext "やあ!会話を始めるにはここをクリックしてください。", textinputplaceholder "ここに入力 ", }, "de de" { calltoactiontext "hi! klicken sie hier, um ein gespräch zu beginnen ", textinputplaceholder "geben sie hier ein ", }, default { calltoactiontext "hi! click here to start a conversation ", textinputplaceholder "type here ", }, }, speechrecognitionlocales "en us\ en gb\ en au", speechrecognitionhintphrases "uneeq, digital human", speechrecognitionhintphrasesboost 20, }; const uneeq = new uneeq(uneeqoptions);