
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
channel3-sdk
Advanced tools
The official TypeScript/JavaScript SDK for the Channel3 AI Shopping API. Search for products using text, images, and advanced filters with AI-powered semantic search.
npm install channel3-sdk
# or
yarn add channel3-sdk
# or
pnpm add channel3-sdk
import { Channel3Client } from 'channel3-sdk';
const client = new Channel3Client({
apiKey: process.env.CHANNEL3_API_KEY!,
});
// Search for products
const products = await client.search({
query: 'blue denim jacket',
});
console.log(`Found ${products.length} products`);
products.forEach((product) => {
console.log(`${product.title} - $${product.price.price} ${product.price.currency}`);
});
// Search with custom configuration and context
const results = await client.search({
query: 'running shoes',
config: {
enrich_query: true, // Enable query enrichment
semantic_search: true, // Enable semantic search
},
context: 'Looking for athletic footwear for marathon training',
filters: {
price: { min_price: 50, max_price: 200 },
gender: 'male',
brand_ids: ['nike-id', 'adidas-id'],
},
limit: 10,
});
// Search by image URL
const imageResults = await client.search({
image_url: 'https://example.com/product-image.jpg',
});
// Search by base64 image
const base64Results = await client.search({
base64_image: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ...',
});
interface Channel3ClientConfig {
apiKey: string; // Your Channel3 API key
}
search(options: SearchRequest): Promise<Product[]>
Search for products with various options.
Parameters:
query?: string
- Text search queryimage_url?: string
- URL of image for visual searchbase64_image?: string
- Base64-encoded image for visual searchconfig?: SearchConfig
- Search configuration optionscontext?: string
- Additional context for the searchfilters?: SearchFilters
- Advanced filtering optionslimit?: number
- Maximum results to return (default: 20)getProduct(productId: string): Promise<ProductDetail>
Get detailed information about a specific product.
getBrands(options?: GetBrandsV0BrandsGetRequest): Promise<PaginatedResponseBrand>
Get list of available brands with pagination.
getBrand(brandId: string): Promise<Brand>
Get detailed information about a specific brand.
interface SearchConfig {
enrich_query?: boolean; // Enable AI query enrichment (default: true)
semantic_search?: boolean; // Enable semantic search (default: true)
}
interface SearchFilters {
brand_ids?: string[]; // Filter by specific brand IDs
gender?: 'male' | 'female' | 'unisex'; // Gender filter
price?: {
// Price range filter
min_price?: number;
max_price?: number;
};
availability?: AvailabilityStatus[]; // Availability filter
}
CHANNEL3_API_KEY
- Your Channel3 API key (required)CHANNEL3_BASE_PATH
- Custom API base path (optional, for local development)For local development against your own backend:
# Set environment variables
export CHANNEL3_BASE_PATH="http://localhost:8000"
export CHANNEL3_API_KEY="your_dev_key"
# Create test script
cat > test-local.mjs << 'EOF'
import { Channel3Client } from 'channel3-sdk';
const client = new Channel3Client({ apiKey: process.env.CHANNEL3_API_KEY });
const products = await client.search({ query: 't-shirt' });
console.log(`Found ${products.length} products`);
EOF
# Run test
node test-local.mjs
The SDK provides specific error types for different scenarios:
import {
Channel3AuthenticationError, // 401 - Invalid API key
Channel3ValidationError, // 422 - Invalid request data
Channel3NotFoundError, // 404 - Resource not found
Channel3ServerError, // 500 - Server error
Channel3ConnectionError, // Network/timeout errors
} from 'channel3-sdk';
try {
const products = await client.search({ query: 'shoes' });
} catch (error) {
if (error instanceof Channel3AuthenticationError) {
console.error('Invalid API key');
} else if (error instanceof Channel3ValidationError) {
console.error('Invalid request:', error.message);
} else if (error instanceof Channel3ConnectionError) {
console.error('Network error:', error.message);
}
}
This SDK is automatically generated from the Channel3 OpenAPI specification. To regenerate types after API updates:
npm run openapi:generate
Works in modern browsers that support:
MIT License - see LICENSE file for details.
Made with ❤️ by the Channel3 team
FAQs
The official TypeScript/JavaScript SDK for Channel3 AI Shopping API
The npm package channel3-sdk receives a total of 41 weekly downloads. As such, channel3-sdk popularity was classified as not popular.
We found that channel3-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.