FDK client for Javascript
Get started with the Javascript Development SDK for Fynd Platform
npm install fdk-client-javascript --save
Using this method, you can require
fdk-client-javascript like so:
const {
ApplicationConfig,
ApplicationClient,
} = require("fdk-client-javascript");
const config = new ApplicationConfig({
applicationID: "YOUR_APPLICATION_ID",
applicationToken: "YOUR_APPLICATION_TOKEN",
});
const applicationClient = new ApplicationClient(config);
async function getProductDetails() {
try {
const product = await applicationClient.catalog.getProductDetailBySlug('product-slug');
console.log(product.name);
} catch (err) {
console.log(err);
}
}
getProductDetails();
fdk-client-javascript includes Typescript definitions.
import { ApplicationConfig, ApplicationClient } from "fdk-client-javascript";