Getting Started
Get Produck SDK up and running in 5 minutes. This guide covers account setup, installation, and your first AI-powered integration.
Prerequisites
- Node.js 16.x or higher (Download here (opens in a new tab))
- A Produck account (Sign up free (opens in a new tab))
- React 18+ (for React apps) or any modern JavaScript framework
What You'll Build
By the end of this guide you'll have:
- ✅ A working AI chat widget on your site
- ✅ A knowledge base teaching the AI about your product
- ✅ Understanding of how to add API actions and DOM context
Step 1: Create Your SDK Project
1.1 Sign Up / Log In
- Go to Produck Dashboard (opens in a new tab)
- Sign up with your email or log in
- Verify your email
1.2 Create an Organization
- Enter your Organization Name (e.g., "Acme Corp")
- Choose a subdomain
- Click Create Organization
1.3 Create an SDK Project
- Click SDK Projects in the sidebar
- Click "+ New SDK Project"
- Enter a project name and click Create
1.4 Copy Your SDK Key
Copy the SDK key — it looks like:
pk_live_1768387697_vVnwFeC6cmHuUMelStep 2: Install the SDK
For React / Next.js
npm install @prodact.ai/sdkFor WordPress
See the WordPress Installation Guide.
For Vanilla JavaScript
See Vanilla JS Guide.
Step 3: Add the Provider and Chat Widget
React / Next.js
app/layout.tsx
import { ProduckProvider, ProduckChat } from '@prodact.ai/sdk/react'
export default function RootLayout({ children }) {
return (
<html>
<body>
<ProduckProvider sdkKey={process.env.NEXT_PUBLIC_SDK_KEY}>
{children}
<ProduckChat position="bottom-right" />
</ProduckProvider>
</body>
</html>
)
}Vanilla JavaScript / CDN
<script src="https://cdn.prodact.ai/sdk.js"></script>
<script>
Produck.init({ sdkKey: 'pk_live_...' })
</script>At this point, you have a working chat widget! But the AI doesn't know about your product yet.
Step 4: Add Knowledge Base Sources
Go to the Produck Dashboard (opens in a new tab):
- Select your SDK project
- Click the Knowledge Base tab
- Click "Add Source"
- Choose a source type:
- Website URL — crawls and indexes a page
- Sitemap — crawls all pages in a sitemap
- Document — upload PDF, DOCX, or TXT
- Raw Text — paste content directly
Tip: Start with your pricing page, FAQ, and main product pages.
The AI will now answer questions using your actual content.
Step 5: (Optional) Add API Schema
If you want the AI to execute API calls on behalf of users:
app/layout.tsx
<ProduckProvider
sdkKey={process.env.NEXT_PUBLIC_SDK_KEY}
apiSchema="/api/openapi.json"
apiAuth={{ type: 'cookie' }}
allowedEndpoints={[
'GET /api/users/*',
'POST /api/orders',
]}
>
<ProduckChat />
</ProduckProvider>See API Schema for full documentation.
Step 6: (Optional) Enable DOM Context
Let the AI read the current page when users ask about it:
<ProduckProvider
sdkKey={process.env.NEXT_PUBLIC_SDK_KEY}
domContext={{
enabled: true,
selectors: ['main'],
exclude: ['.private-data'],
}}
>
<ProduckChat />
</ProduckProvider>See DOM Context for full documentation.
Full Example
Here's everything together:
app/layout.tsx
import { ProduckProvider, ProduckChat } from '@prodact.ai/sdk/react'
export default function RootLayout({ children }) {
return (
<html>
<body>
<ProduckProvider
sdkKey={process.env.NEXT_PUBLIC_SDK_KEY}
apiSchema="/api/openapi.json"
apiAuth={{ type: 'cookie' }}
allowedEndpoints={[
'GET /api/users/*',
'POST /api/orders',
]}
domContext={{
enabled: true,
selectors: ['main'],
}}
>
{children}
<ProduckChat position="bottom-right" />
</ProduckProvider>
</body>
</html>
)
}What's Next?
- Knowledge Base — Deep dive into teaching the AI
- API Schema — Execute API calls via the AI
- DOM Context — On-demand page reading
- React Integration — Hooks, components, and patterns
- Security — Endpoint whitelisting and data handling