
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@gofynd/fdk-client-javascript
Advanced tools
  ![GitH
FDK client for Javascript
Get started with the Javascript Development SDK for Fynd Platform
npm install @gofynd/fdk-client-javascript
Using this method, you can require
fdk-client-javascript like so:
const {
ApplicationClient,
} = require("fdk-client-javascript");
you can load fdk-client-javascript's application browser bundle from CDN; ApplicationClient
and ApplicationModels
will be attached to browser's window
object.
<script src="https://cdn.jsdelivr.net/gh/gofynd/fdk-client-javascript@<version>/dist/application.js"></script>
Install Specific version
<script src="https://cdn.jsdelivr.net/gh/gofynd/fdk-client-javascript@1.1.0/dist/application.js"></script>
const { ApplicationClient } = window;
For logging support user can pass logLevel
in ApplicationClient
or PlatformClient
while declaration.
Available logging levels: TRACE, DEBUG, INFO, WARN, ERROR.
Default log level: ERROR
const applicationClient = new ApplicationClient({
applicationID: "YOUR_APPLICATION_ID",
applicationToken: "YOUR_APPLICATION_TOKEN",
locationDetails: "LOCATION_DETAILS_OBJECT"
});
applicationClient.setLocationDetails({
pincode:"385001",
country: "India",
city: "Ahmedabad",
location: {longitude: "72.585022", latitude: "23.033863"}
});
async function getProductDetails() {
try {
const product = await applicationClient.catalog.getProductDetailBySlug({
slug: "product-slug"
});
console.log(product.name);
} catch (err) {
console.log(err);
}
}
getProductDetails();
const { PlatformClient } = require("fdk-client-javascript");
async function getData() {
try {
const client = new PlatformClient({
companyId: "COMPANY_ID",
apiKey: "API_KEY",
apiSecret: "API_SECRET",
domain: "DOMAIN",
useAutoRenewTimer: true // Setting `true` will use timer based logic to refresh the access token. With `false` will issue refresh token just before any api call when it is expired.
});
const token = await platformClient.getAccesstokenObj({
grant_type: 'client_credentials'
})
platformClient.setToken(token);
// API's without application_id
const tickets = await client.lead.getTickets();
console.log("tickets", tickets);
// API's with application_id
const customers = await client
.application("APPLICATION_ID")
.user.getCustomers();
console.log("customers", customers);
} catch (err) {
console.log(err);
}
}
getData();
The request function allows you to make custom API requests with ease. It is available on both platform
and application
client.
let auditLog = await client.request({
url: `/service/platform/audit-trail/v1.0/company/1/logs`,
method: 'GET',
});
The request
function accepts an object with the following possible keys:
Following code snippet will read and write cookies on behalf of you
Cookies will get appended in subsequent requests.
const { FdkAxios } = require('@gofynd/fdk-client-javascript');
const { wrapper } = require("axios-cookiejar-support");
const { CookieJar } = require("tough-cookie");
wrapper(FdkAxios);
const cookieJar = new CookieJar();
FdkAxios.defaults.jar = cookieJar;
module.exports = cookieJar
get the stored cookie from the CookieJar instance
const cookieJar = require('path/to/cookieJar') // replace with actual path
let cookies = await cookieJar.getCookies("https://api.fynd.com");
To include request headers when calling a method, add requestHeaders
object in the first argument.
const requestHeaders = {
"x-api-version": "1.0"
}
const options = {
responseHeaders: true
}
const [response, headers] = await platformClient.application("<APPLICATION_ID>").theme.getAllPages({theme_id: "<THEME_ID>", requestHeaders: requestHeaders}, options);
To retrieve the response headers, simply set the responseHeaders
option to true
when calling the desired method. Below is an example demonstrating how to achieve this:
const options = {
responseHeaders: true
}
const [response, headers] = await platformClient.application("<APPLICATION_ID>").theme.getAllPages({theme_id: "<THEME_ID>"}, options);
console.log("[API RESPONSE]: ", response);
console.log("[RESPONSE HEADERS]: ", headers);
To print the curl command in the console for all network calls made using applicationClient
or platformClient
, set the logger level to debug.
const {
ApplicationClient,
} = require("fdk-client-javascript");
let applicationClient = new ApplicationClient({
applicationID: "YOUR_APPLICATION_ID",
applicationToken: "YOUR_APPLICATION_TOKEN",
logLevel: "debug"
});
let response = await applicationClient.theme.getAppliedTheme();
console.log("Active Theme: ", response.information.name);
The above code will log the curl command in the console
curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 3.4.3' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
Active Theme: Emerge
fdk-client-javascript includes Typescript definitions.
import { ApplicationClient } from "fdk-client-javascript";
FAQs
  ![GitH
The npm package @gofynd/fdk-client-javascript receives a total of 0 weekly downloads. As such, @gofynd/fdk-client-javascript popularity was classified as not popular.
We found that @gofynd/fdk-client-javascript demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 15 open source maintainers 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.