Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/brave-dancers-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@openai/chatkit': patch
---

Added missing types for `chatkit.ready` event
5 changes: 5 additions & 0 deletions .changeset/brown-hairs-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@openai/chatkit-react': minor
---

Add `onReady` to `UseChatKitOptions`
1 change: 1 addition & 0 deletions packages/chatkit-react/src/ChatKit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const ChatKit = React.forwardRef<OpenAIChatKit, ChatKitProps>(
'chatkit.thread.change': 'onThreadChange',
'chatkit.thread.load.start': 'onThreadLoadStart',
'chatkit.thread.load.end': 'onThreadLoadEnd',
'chatkit.ready': 'onReady',
};

const eventNames = Object.keys(events) as (keyof ChatKitEvents)[];
Expand Down
3 changes: 3 additions & 0 deletions packages/chatkit/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,9 @@ export interface OpenAIChatKit extends HTMLElement {
* DOM events emitted by the `openai-chatkit` custom element.
*/
export type ChatKitEvents = {
/** Emitted when the ChatKit frame has loaded. */
'chatkit.ready': CustomEvent<void>;

/** Emitted when an error occurs. You should log these for monitoring and debugging. */
'chatkit.error': CustomEvent<{ error: Error }>;

Expand Down