Skip to content

Quick start

Paste the ChatKit script, render the component, and your chat UI is ready. Toggle between React and vanilla JavaScript below to see the full snippet for each setup.

<!-- Add once to your root HTML -->
<script
src="https://cdn.platform.openai.com/deployments/chatkit/chatkit.js"
async
></script>
Terminal window
npm install @openai/chatkit-react
import { ChatKit, useChatKit } from '@openai/chatkit-react';
export function SupportChat() {
const { control } = useChatKit({
api: {
url: 'http://localhost:8000/chatkit',
domainKey: 'local-dev',
},
});
return <ChatKit control={control} className="h-[600px] w-[360px]" />;
}