Markprompt

Renders the pre-built Markprompt component, including chat and search views, and trigger component.

Basic example

1import { Markprompt } from '@markprompt/react';
2
3function Example() {
4  return (
5    <Markprompt
6      projectKey="YOUR-PROJECT-KEY"
7      chatOptions={{
8        placeholder: 'Send message',
9        history: true,
10        avatars: {
11          user: '/avatars/user.png',
12          assistant: '/avatars/assistant.png',
13        },
14        defaultView: {
15          message: "Hello, I'm an AI assistant from Acme!",
16          prompts: [
17            'What is Markprompt?',
18            'How do I setup the React component?',
19            'Do you have a REST API?',
20          ],
21        },
22      }}
23      feedbackOptions={{
24        votes: true,
25        csat: true
26      }}
27      integrations={{
28        createTicket: {
29          enabled: true,
30          provider: 'zendesk',
31        },
32      }}
33    >
34      <button>Open Markprompt</button>
35    </Markprompt>
36  );
37}

Component API

PropTypeDescription
projectKeystringThe project key associated to your project.
apiUrlstring = "https://api.markprompt.com"The base API URL.
childrenReact.ReactNodeTrigger component, such as a search button or a floating chat bubble.
displayMarkpromptDisplay = "sheet"The way to display the chat/search content.
stickyboolean = falseEnable user interactions outside of the dialog while keeping it open.
defaultViewView = "search"The default view to show when both chat and search are enabled.
layout'panels' | 'tabs' = "panels"Multi-pane layout when both search and chat are enabled.
menuMenuOptionsOptions for the menu component.
chatUserConfigurableOptions & ChatOptionsOptions for the chat component.
searchSubmitSearchQueryOptions & SearchOptionsOptions for the search component.
feedbackSubmitFeedbackOptions & FeedbackOptionsOptions for the feedback component.
referencesReferencesOptionsOptions for the references component.
integrationsIntegrationsOptionsOptions for integrations.
triggerTriggerOptionsOptions for the trigger component.
closeCloseOptionsOptions for the close button.
descriptionDescriptionOptionsOptions for the description.
titleTitleOptionsOptions for the title component.
linkAsstring | ComponentType<any> = "a"Component to use in place of <a>.
showBrandingboolean = trueOptions for the title component.
brandingBrandingOptionsOptions for the title component.
debugboolean = falseDisplay debug info.