@products-db/client
v1.0.0
Published
Official Node.js SDK for ProductsDB: Effortlessly integrate product data into your applications with powerful features and seamless authentication.
Downloads
122
Maintainers
Readme
Features 🌟
- Easy Integration: Quick setup with minimal configuration required.
- Robust Functionality: Access a wide range of endpoints for real-time product data retrieval and management.
- Multi-language Support: Localized data available in 24 languages.
- Secure Authentication: Built-in API key authentication for secure data access.
Getting Started 🛠️
To start using the ProductsDB Node.js SDK, simply install the package and follow our comprehensive documentation for setup and usage examples.
npm install @products-db/client
or, using yarn:
yarn add @products-db/client
Usage 💻
JavaScript Example
Here’s a quick example of how to use the ProductsDB SDK in JavaScript to search for a product by its EAN code:
// Import the SDK
import { ProductsDBClient } from '@products-db/client';
// Initialize the client with your API key
const client = new ProductsDBClient({ apiKey: 'YOUR_API_KEY' });
// Search for a product by EAN
client
.search({ ean: '123456789012', language: 'ja' })
.then((product) => console.log(product))
.catch((error) => console.error('Error fetching product:', error));
TypeScript Example
For TypeScript users, here’s how to set up and use the SDK with type definitions for enhanced development:
// Import the SDK
import { ProductsDBClient } from '@products-db/client';
// Initialize the client with your API key
const client = new ProductsDBClient({ apiKey: 'YOUR_API_KEY' });
// Search for a product by EAN
client
.search({ ean: '123456789012', language: 'ja' })
.then((product) => console.log(product))
.catch((error) => console.error('Error fetching product:', error));
Documentation 📚
For more details on available endpoints and methods, please visit our official documentation.