Build production-ready RAG interfaces in minutes, not months
Translation pending
Developer toolsTypeScript · JavaScriptGitHub @Poll-The-PeopleOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
CustomGPT.ai’s RAG API’s Starter Kit, including multi-instance embedded widgets, floating buttons, and standalone application.
Translation pending
Taken from the repository README
Loading the full README.
Read the full README ↗This project implements several security best practices:
.env.localWant to customize or develop? Run the project locally:
git clone https://github.com/Poll-The-People/customgpt-starter-kit.git
cd customgpt-starter-kit
npm install
# or
pnpm install
cp .env.example .env.local
.env.local:# Required - Server-side only (never exposed to client)
CUSTOMGPT_API_KEY=your-api-key-here
# Optional - For voice features (speech-to-text, voice chat)
OPENAI_API_KEY=your-openai-api-key-here
# Optional - Custom API base URL
CUSTOMGPT_API_BASE_URL=https://app.customgpt.ai/api/v1
# Optional - Rate limiting & bot protection (enterprise features)
UPSTASH_REDIS_REST_URL=https://your-redis-url.upstash.io
UPSTASH_REDIS_REST_TOKEN=your-redis-token
TURNSTILE_SITE_KEY=your-turnstile-site-key
TURNSTILE_SECRET_KEY=your-turnstile-secret-key
TURNSTILE_ENABLED=true
For rate limiting and bot protection (Turnstile), add these optional environment variables:
These features provide enterprise-grade protection but are completely optional. The app works perfectly without them.
npm run dev
The app will be available at http://localhost:3000
If you don't want to add API keys to environment files, you can use Demo Mode:
.env.localDemo Mode Features:
Add CustomGPT.ai chat to any website with these options:
Zero setup required - just copy and paste:
<!-- Embedded Chat Widget -->
<div id="my-chat" style="width: 400px; height: 600px;"></div>
<script src="https://cdn.jsdelivr.net/gh/Poll-The-People/customgpt-starter-kit@main/dist/widget/customgpt-widget.js"></script>
<script>
CustomGPTWidget.init({
agentId: YOUR_AGENT_ID, // Get from CustomGPT.ai dashboard
containerId: 'my-chat'
});
</script>
Want a floating button? Just change to:
CustomGPTWidget.init({
agentId: YOUR_AGENT_ID,
mode: 'floating',
position: 'bottom-right'
});
✅ CDN Benefits:
When you need to modify the widget source:
# Build the widget locally
npm run build:widget
# Host the dist/widget/ files on your server
# Then use your own URL:
<script src="https://your-domain.com/dist/widget/customgpt-widget.js"></script>
<script>
CustomGPTWidget.init({
agentId: 123,
containerId: 'chat-widget'
});
</script>
For enterprise security requirements:
<script src="https://your-domain.com/iframe-embed.js"></script>
<script>
const widget = CustomGPTEmbed.init({
agentId: 123,
mode: 'floating',
iframeSrc: 'https://your-domain.com/widget/',
position: 'bottom-right'
});
</script>
Security Benefits:
Quick React Hook using GitHub CDN:
import { useEffect, useRef } from 'react';
function ChatWidget({ agentId }) {
const widgetRef = useRef(null);
useEffect(() => {
// Load widget from CDN
const script = document.createElement('script');
script.src = 'https://cdn.jsdelivr.net/gh/Poll-The-People/customgpt-starter-kit@main/dist/widget/customgpt-widget.js';
script.onload = () => {
const widget = window.CustomGPTWidget.init({
agentId: agentId,
containerId: 'my-chat',
mode: 'embedded'
});
widgetRef.current = widget;
};
document.body.appendChild(script);
return () => widgetRef.current?.destroy();
}, [agentId]);
return <div id="my-chat" style={{ height: '600px' }} />;
}
// Usage
<ChatWidget agentId={123} />
Or use our pre-built React components:
// See examples/SimplifiedWidget.jsx and examples/SimplifiedFloatingButton.jsx
import SimplifiedWidget from './examples/SimplifiedWidget';
<SimplifiedWidget
agentId={123}
enableConversationManagement={true}
theme="dark"
/>
| Option | Type | Required | Description |
|---|---|---|---|
agentId | number/string | Yes | Your CustomGPT.ai agent ID |
mode | string | No | 'embedded', 'floating', or 'fullscreen' |
theme | string | No | 'light' or 'dark' (default: 'light') |
| Option | Type | Default | Description |
|---|---|---|---|
containerId | string | - | DOM element ID for embedded mode |
position | string | 'bottom-right' | Position for floating mode |
width | string | '400px' | Widget width |
height | string | '600px' | Widget height |
borderRadius | string | '12px' | Corner radius |
zIndex | number | 9999 | Stack order |
| Option | Type | Default | Description |
|---|---|---|---|
enableCitations | boolean | true | Show citation sources |
enableFeedback | boolean | true | Show thumbs up/down buttons |
sessionId | string | auto | Custom session identifier |
isolateConversations | boolean | false | Isolate conversations per page |
| Option | Type | Required | Description |
|---|---|---|---|
iframeSrc | string | Yes | URL where iframe app is hosted |
This application includes full PWA functionality but it is disabled by default to provide a cleaner user experience. The PWA features include:
To enable the PWA install prompt and functionality:
src/app/layout.tsximport { PWAManager } from '@/components/pwa/PWAManager';
<PWAManager />
The PWA will then show an install prompt to users and provide the full Progressive Web App experience.
The PWA settings are configured in:
public/manifest.json - App metadata, icons, theme colorspublic/sw.js - Service worker for offline cachingsrc/components/pwa/PWAManager.tsx - Install prompt UI and update handling# Build everything
npm run build:all
# Build individual components
npm run build:widget # Widget bundle only
npm run build:iframe # Iframe app only
npm run build # Next.js standalone app
dist/widget/)customgpt-widget.js (179KB) - Main widget bundlecustomgpt-widget.css (76KB) - Widget stylesvendors.js (1.57MB) - React and dependenciesindex.html - Demo/test pagedist/iframe/)iframe-app.js (154KB) - Iframe applicationiframe-app.css (75KB) - Iframe stylesvendors.js (1.57MB) - Shared dependenciesindex.html - Iframe container.next/ - Next.js build outputKey Features:
The project includes comprehensive Docker support with flexible deployment options:
# Quick start - Main application only
docker-compose up app
# Widget only
docker-compose --profile widget up widget
# Iframe only
docker-compose --profile iframe up iframe
# Everything with production proxy
docker-compose --profile all up
# Development environment
docker-compose --profile dev up dev
Setup:
cp .env.docker.example .envCUSTOMGPT_API_KEY=your-api-key-hereOPENAI_API_KEY=your-openai-key-here (optional, for voice features)docker-compose up appAvailable Services:
app (port 3000): Full Next.js application with dashboardwidget (port 8080): Widget-only static files for embeddingiframe (port 8081): Iframe-only static files for embeddingnginx (ports 80/443): Production reverse proxy with SSLdev (ports 3000/8080/8081): Development environment with hot reloadCUSTOMGPT_API_KEY: Your API key# Build widget files
npm run build:widget
npm run build:iframe
# Upload dist/widget/ and dist/iframe/ to your CDN or static host
# Build specific deployment target
docker build --target standalone -t customgpt-ui:app .
docker build --target widget -t customgpt-ui:widget .
docker build --target iframe -t customgpt-ui:iframe .
# Run standalone app
docker run -p 3000:3000 -e CUSTOMGPT_API_KEY=your-key customgpt-ui:app
# Run widget server
docker run -p 8080:80 customgpt-ui:widget
# Run iframe server
docker run -p 8081:80 customgpt-ui:iframe
The examples/ directory contains complete widget integration examples for every framework and use case.
📖 View Complete Examples Guide →
Development/Demo Setup:
<script src="https://cdn.jsdelivr.net/gh/Poll-The-People/customgpt-starter-kit@main/dist/widget/customgpt-widget.js"></script>
<script>
CustomGPTWidget.init({
agentId: 'YOUR_AGENT_ID',
apiKey: 'YOUR_API_KEY', // ⚠️ Development only
containerId: 'chat-container'
});
</script>
React Production Setup:
<SimplifiedWidget
agentId={process.env.REACT_APP_CUSTOMGPT_AGENT_ID}
apiBaseUrl="http://localhost:3001/api/customgpt"
/>
Next.js Production Setup:
<SimplifiedWidget
agentId={process.env.NEXT_PUBLIC_CUSTOMGPT_AGENT_ID}
apiBaseUrl="/api/customgpt"
/>
quick-start.html - Interactive demo and testing toolSimplifiedWidget.jsx, SimplifiedFloatingButton.jsxvanilla-js-widget.html, widget-direct-api.htmliframe-embed-example.htmluniversal-proxy-server.js, nextjs-api-route.js🔗 Complete Examples Documentation →
customgpt-starter-kit/
├── app/ # Next.js app directory
│ └── api/
│ └── proxy/ # Secure API proxy routes
├── src/
│ ├── components/ # React components
│ ├── store/ # State management (Zustand)
│ ├── lib/ # Utilities and API client
│ └── widget/ # Widget-specific code
├── public/ # Static assets
├── dist/ # Build outputs
└── examples/ # Integration examples
# Start development server
npm run dev
# Run widget dev server
npm run dev:widget
# Type checking
npm run type-check
# Linting
npm run lint
# Run all builds
npm run build:all
src/components/src/lib/api/src/store/src/widget/The application uses Next.js API routes as a proxy to securely handle API authentication:
All API calls go through /api/proxy/* which adds the API key server-side:
/api/proxy/agents - Agent management/api/proxy/conversations - Conversation handling/api/proxy/messages - Message operations/api/proxy/sources - Source management# Required - Your CustomGPT.ai API key (server-side only)
CUSTOMGPT_API_KEY=your-api-key-here
# Optional - For voice features (speech-to-text, voice chat)
OPENAI_API_KEY=your-openai-api-key-here
# Optional - Custom API base URL
CUSTOMGPT_API_BASE_URL=https://app.customgpt.ai/api/v1
# Optional - Allowed origins for CORS
ALLOWED_ORIGINS=https://yourdomain.com,https://anotherdomain.com
.env.localMIT License - see LICENSE file for details.