diff --git a/README.md b/README.md index 51c7324..8f0c23d 100644 --- a/README.md +++ b/README.md @@ -57,12 +57,13 @@ const App = () => ( | ---------------------------------- | -------------- | ------------------------------------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `memoriName` | \* (see below) | `string` | | Name of the Memori | | `ownerUserName` | \* (see below) | `string` | | Username of the Memori owner | -| `memoriID` | \* (see below) | `string` | | ID of the Memori (agent) | +| `memoriID` | \* (see below) | `string` | | ID of the Memori (agent) | | `ownerUserID` | \* (see below) | `string` | | ID of the Memori owner | | `tenantID` | ✔️ | `string` | | Tenant ID, example: "aisuru.com" or "app.memorytwin.com" | | `sessionID` | | `string` | | Initial Session ID, UUID which refers to the session to the Memori and identifies a conversation and its permissions (giver, receiver, anonymous). A session would be started autonomously with the params set, but if you have an existing and valid sessionID you can pass it as already opened one. Use this at your risk, as session recovery might break or start session as anon user. In most cases, you shoudn't use this prop. | | `authToken` | | `string` | | Authentication token from user login, needed for giver sessions to upload assets | | `integrationID` | | `string` | | Integration ID, UUID which refers to the public page layout | +| `integration` | | `Integration` | | Integration object | | `secretToken` | | `string` | | Secret token, the password of a private or secret Memori | | `height` | | `string` | "100%" | Height of the Memori | | `showShare` | | `bool` | `true` | Show the share button | @@ -89,7 +90,7 @@ const App = () => ( | `enableAudio` | | `boolean` | `true` | Enable audio output. Defaults to true if otherwise indicated by props or integration config. | | `defaultSpeakerActive` | | `boolean` | `true` | Default value for the speaker activation | | `disableTextEnteredEvents` | | `boolean` | `false` | Disable MemoriTextEntered events listeners for `typeMessage` functions, useful to avoid issues with multiple widgets in page. | -| `useMathFormatting` | | `boolean` | `false` | Apply math formatting to the messages, defaults to false if otherwise indicated by props or integration config. | +| `useMathFormatting` | | `boolean` | `false` | Apply math formatting to the messages, defaults to false if otherwise indicated by props or integration config. | | `AZURE_COGNITIVE_SERVICES_TTS_KEY` | | `string` | | Azure Cognitive Services TTS key, used to generate the audio of the Memori and for STT recognition | | `layout` | | `string` | | Layout of the Memori, can be "FULLPAGE" (default), "CHAT", "WEBSITE_ASSISTANT", "TOTEM", "HIDDEN_CHAT" or "ZOOMED_FULL_BODY". see [below](#layouts) | | `customLayout` | | `React.FC` | | Custom layout component, see [below](#custom-layout) | diff --git a/src/index.tsx b/src/index.tsx index 2a1a3cf..799d018 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -5,6 +5,7 @@ import { DialogState, Memori as IMemori, Tenant, + Integration, } from '@memori.ai/memori-api-client/dist/types'; import memoriApiClient from '@memori.ai/memori-api-client'; @@ -15,7 +16,6 @@ import { VisemeProvider } from './context/visemeContext'; import { Toaster } from 'react-hot-toast'; import { getTenant } from './helpers/tenant'; -import { installMathJax } from './helpers/utils'; import i18n from './i18n'; import { useTranslation } from 'react-i18next'; @@ -26,6 +26,7 @@ export interface Props { memoriID?: string | null; ownerUserName?: string | null; ownerUserID?: string | null; + integration?: Integration; integrationID?: string; tenantID: string; secretToken?: string; @@ -91,6 +92,7 @@ const Memori: React.FC = ({ ownerUserID, memoriName, memoriID, + integration, integrationID, tenantID, secretToken, @@ -269,11 +271,14 @@ const Memori: React.FC = ({ showContextPerLine={showContextPerLine} showLogin={showLogin ?? memori?.enableDeepThought} showUpload={showUpload} - integration={memori?.integrations?.find(i => - integrationID - ? i.integrationID === integrationID - : !!i.publish && i.type === 'LANDING_EXPERIENCE' - )} + integration={ + integration ?? + memori?.integrations?.find(i => + integrationID + ? i.integrationID === integrationID + : !!i.publish && i.type === 'LANDING_EXPERIENCE' + ) + } initialContextVars={context} initialQuestion={initialQuestion} authToken={authToken} @@ -321,6 +326,7 @@ Memori.propTypes = { ownerUserName: PropTypes.string, ownerUserID: PropTypes.string, integrationID: PropTypes.string, + integration: PropTypes.any, tenantID: PropTypes.string.isRequired, secretToken: PropTypes.string, sessionID: PropTypes.string,