Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.08 KB

README.md

File metadata and controls

57 lines (40 loc) · 1.08 KB

FDK Javascript

FDK client for Javascript

Getting Started

Get started with the Javascript Development SDK for Fynd Platform

Usage

npm install fdk-client-javascript --save

Using this method, you can require fdk-client-javascript like so:

const {
  ApplicationConfig,
  ApplicationClient,
} = require("fdk-client-javascript");

Sample Usage:

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();

TypeScript

fdk-client-javascript includes Typescript definitions.

import { ApplicationConfig, ApplicationClient } from "fdk-client-javascript";

Documentation