New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ssapi-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssapi-wrapper

Just a SearchSpring API Wrapper for JavaScript client-side or NodeJS applications...

latest
Source
npmnpm
Version
2.1.1
Version published
Maintainers
1
Created
Source

SSAPI Wrapper

Just a SearchSpring API Wrapper for JavaScript client-side or NodeJS applications...

Install

pnpm

pnpm add ssapi-wrapper

npm

npm i ssapi-wrapper

Usage

import * as SSAPI from 'ssapi-wrapper'

// define new client
const api = new SSAPI.Client( 'siteId', { resultsPerPage: 10 } );

// define callback for the "search" event
api.on('search', ({ detail: response }) => {
    console.log(response);
});

// execute functions and trigger search
const singleRequest = api
    .backgroundFilter( 'category', 'clothing' ) // methods can be chained in sequence to modify the state
    .query( 'shirts' )
    .sort( 'price', 'asc' )
    .filter( 'size', 'Small' )
    .filter( 'color', 'Red' )
    .page( 2 )
    .search(); // the request will only be sent once the `search` method is called

// alternatively handle the promise generated from the `search` method
const response = await singleRequest;

Autocomplete

import * as SSAPI from 'ssapi-wrapper'

// define new client
const api = new SSAPI.Client( 'siteId', {}, { limit: 4 } );

// define callback for the "autocomplete" event
api.on('autocomplete', ({ detail: response }) => {
    console.log(response);
});

// execute functions and trigger autocomplete
const singleRequest = api
    .query( 'shirts' )
    .autocomplete(); // the request will only be sent once the `autocomplete` method is called

// alternatively handle the promise generated from the `autocomplete` method
const response = await singleRequest;

FAQs

Package last updated on 18 Jan 2022

Did you know?

Socket

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.

Install

Related posts