-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: GROW-272 - add inkeep to use-cases (demo) page
- Loading branch information
1 parent
88bcd34
commit 8470e95
Showing
5 changed files
with
3,494 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use client'; | ||
|
||
import dynamic from 'next/dynamic'; | ||
import { InkeepChatButtonProps } from '@inkeep/uikit'; | ||
import useInkeepSettings from '../useInkeepSettings'; | ||
|
||
const ChatButton = dynamic(() => import('@inkeep/uikit').then((mod) => mod.InkeepChatButton), { | ||
ssr: false, | ||
}); | ||
|
||
function InkeepChatButton() { | ||
const { baseSettings, aiChatSettings, searchSettings, modalSettings } = useInkeepSettings(); | ||
|
||
const chatButtonProps: InkeepChatButtonProps = { | ||
baseSettings, | ||
aiChatSettings, | ||
searchSettings, | ||
modalSettings, | ||
}; | ||
|
||
return <ChatButton {...chatButtonProps} />; | ||
} | ||
|
||
export default InkeepChatButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import type { | ||
InkeepAIChatSettings, | ||
InkeepSearchSettings, | ||
InkeepBaseSettings, | ||
InkeepModalSettings, | ||
} from '@inkeep/uikit'; | ||
import { AIChatDisclaimerSettings } from '@inkeep/uikit'; | ||
|
||
type InkeepSharedSettings = { | ||
baseSettings: InkeepBaseSettings; | ||
aiChatSettings: InkeepAIChatSettings; | ||
searchSettings: InkeepSearchSettings; | ||
modalSettings: InkeepModalSettings; | ||
}; | ||
|
||
const useInkeepSettings = (): InkeepSharedSettings => { | ||
const baseSettings: InkeepBaseSettings = { | ||
apiKey: '64fc830c4e4bb4b94990b4a21712e89d79a7a6770efb4043', | ||
integrationId: 'cm2kpiuzn04o2uk7k2mwkdy3n', | ||
organizationId: 'org_d0VDri411QUR4Xi7', | ||
primaryBrandColor: '#F04405', | ||
//logEventCallback: customAnalyticsCallback, | ||
}; | ||
|
||
const disclaimerSettings: AIChatDisclaimerSettings = { | ||
isDisclaimerEnabled: true, | ||
disclaimerLabel: 'Information', | ||
disclaimerTooltip: | ||
'Powered by our friends at Inkeep, this AI assistant uses information from our documentation and website. Please do not provide sensitive or personal information. AI answers are not guaranteed to be accurate in all cases. For complex issues, consult our official documentation or contact support.', | ||
}; | ||
|
||
const modalSettings: InkeepModalSettings = {}; | ||
|
||
const searchSettings: InkeepSearchSettings = {}; | ||
|
||
const aiChatSettings: InkeepAIChatSettings = { | ||
chatSubjectName: 'Fingerprint', | ||
botAvatarSrcUrl: 'https://fingerprint.com/img/uploads/fpjs-small-logo-for-email.png', | ||
disclaimerSettings: disclaimerSettings, | ||
getHelpCallToActions: [ | ||
{ | ||
name: 'Contact support', | ||
url: 'https://fingerprint.com/support/', | ||
icon: { | ||
builtIn: 'IoChatbubblesOutline', | ||
}, | ||
}, | ||
{ | ||
name: 'GitHub', | ||
url: 'https://github.com/fingerprintjs', | ||
icon: { | ||
builtIn: 'FaGithub', | ||
}, | ||
}, | ||
{ | ||
name: 'Discord', | ||
url: 'https://discord.gg/ad6R2ttHVX', | ||
icon: { | ||
builtIn: 'FaDiscord', | ||
}, | ||
}, | ||
], | ||
quickQuestions: [ | ||
'How to implement a webhook handler on identification events?', | ||
'How to track visitors across multiple domains?', | ||
'Fingerprint Identification vs FingerprintJS?', | ||
'How to proxy requests through my own domain?', | ||
], | ||
}; | ||
|
||
return { baseSettings, aiChatSettings, searchSettings, modalSettings }; | ||
}; | ||
|
||
export default useInkeepSettings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.