chatkit-integration

Integrate OpenAI ChatKit with custom backends and AI agents.

27|11|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/mjunaidca/mjs-agent-skills --skill chatkit-integration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chatkit-integration
Source: https://github.com/mjunaidca/mjs-agent-skills/tree/main/docs/taskflow-vault/skills/engineering/chatkit-integration
Command: npx skills add https://github.com/mjunaidca/mjs-agent-skills --skill chatkit-integration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Foundation for integrating the OpenAI ChatKit framework with a custom backend and agent. It covers backend server implementation, frontend configuration, authentication, context injection, and persistence.

Core Features & Use Cases

  • Backend: ChatKitServer setup, database persistence, agent wiring
  • Frontend: useChatKit configuration, authentication, context injection
  • Infrastructure: Script loading, httpOnly cookie proxy (Next.js)

Quick Start

Set up a basic project with a ChatKitServer, configure the frontend to use useChatKit, and optionally implement the httpOnly cookie proxy for secure authentication.

Frequently Asked Questions about chatkit-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate OpenAI ChatKit with a custom backend?

Integrate OpenAI ChatKit by setting up a ChatKitServer, configuring frontend useChatKit hooks for authentication and context injection, and wiring agent endpoints. The Skill covers backend persistence, frontend configuration, and infrastructure patterns like httpOnly cookie proxies for secure deployments.

What authentication approach works with ChatKit frontend and backend?

ChatKit authentication uses httpOnly cookies proxied through your backend to prevent XSS exposure. The Skill provides patterns for Next.js cookie proxy setup, custom fetch interceptors on the frontend, and per-user isolation at the server level to enforce secure, session-based access.

How do I inject context into OpenAI prompts within ChatKit?

Inject context by extracting page state on the frontend, passing it through useChatKit configuration, and extending the ChatKitServer respond path on the backend. This enables per-request prompt enrichment while maintaining user isolation and graceful degradation for missing context.

Can I use ChatKit with server-rendered and client-side applications?

ChatKit supports both server-rendered and client-driven interactions. The Skill addresses build-time configuration, SSE-friendly proxies, pre-warmed connections, and streaming UI patterns needed for each rendering model.

What persistence and database setup do I need for ChatKit deployments?

ChatKit deployments require database persistence wired into the ChatKitServer to store conversation history, user state, and agent interactions. The Skill covers backend server implementation patterns and integration points for persistence layers.

How do I configure script loading and streaming for ChatKit on the frontend?

Configure script loading and streaming by setting build-time properties, implementing SSE-friendly proxies, and using custom fetch interceptors to manage streaming responses. The Skill provides infrastructure patterns for both static and dynamic frontend environments.