Developer Documentation
Documentation
Learn how to integrate AI Commerce into your website and start providing intelligent product recommendations to your customers.
Installation
npm / yarn / pnpm
terminal
bash
npm install @yassirbenmoussa/aicommerce-sdkScript Tag (CDN)
For regular HTML websites without a build system:
index.html
html
<script src="https://cdn.aicommerce.dev/sdk/ai-commerce.min.js">script>
<script>
const client = new AICommerceSDK.AICommerce({
apiKey: 'YOUR_API_KEY'
});
client.chat('I need a laptop').then(response => {
console.log(response.products);
});
script>Quick Start
Choose your preferred integration method. We recommend the SDK for the best developer experience.
app.ts
typescript
import { AICommerce } from '@yassirbenmoussa/aicommerce-sdk';
// Initialize the client
const client = new AICommerce({
apiKey: 'YOUR_API_KEY',
});
// Send a message and get product recommendations
const response = await client.chat('I need a laptop under $1000');
console.log(response.reply); // AI response text
console.log(response.products); // Recommended productsTip
The SDK handles authentication, session management, and provides TypeScript types out of the box. We recommend using it for the best developer experience.
🔑 API Key Security
Use Public Key (pk_live_*) for browser code — Use Private Key (sk_live_*) for server-side only
Setup Steps
1
Create an account and verify your email
2
Create your first store and add products
3
Generate an API key from your store dashboard
4
Integrate the chat API into your website