Catalog npm
Back to packageRELEASE DETAILS

0.0.1

npm

6thstreet-algolia-sdk

Algolia wrapper to be used on both mobile-app and web

Published14 Jan 2026
Direct dependencies27
Transitive dependenciesNot calculated

README

Current package documentation

Algolia SDK

Algolia wrapper to be used on both mobile-app and web.

Methods

Init

The first function that should be called when using the SDK. This function will set the Algolia object based on Algolia keys.

  • appID - Algolia application ID
  • searchKey - Algolia search Key
  • options - This is an optional object, with the following keys:
    • customIndices This is a list of custom indices grouped by locale, that will override the default values from config

E.g:

{
  customIndices: {
    "en-ae": {
      default: 'uat_english_products',
      latest: 'uat_english_products_created_at_desc',
      price_low: 'uat_english_products_price_default_asc',
      price_high: 'uat_english_products_price_default_desc',
      discount: 'uat_english_products_discount_desc'
    }
  }
}
import AlgoliaSDK from '@6thstreetdotcom/algolia-sdk';

AlgoliaSDK.init(appID, searchKey);

SetIndex

This function will set the Algolia index based on locale and env settings.

setIndex(locale, env);
  • locale - environment used for getting the right indexes
    • default: 'en-ae'
  • env - environment used for getting the right indexes
    • default: 'production'
    • values: ENUM = ('staging', 'production')
import AlgoliaSDK from 'Algolia-sdk';

AlgoliaSDK.setIndex('en-ae', 'production');

Search using any available facet. Use comma , separated values for multiple values per facet.

To search using a search query, use the q param, as described below.

AlgoliaSDK.search({
  q: 'Adidas',
  hitsPerPage: 4,
  'categories.level1': 'Women /// Shoes',
  gender: 'Women'
});

Response: search-data.json

GetBrands

Search by a query string

getBrands(gender);
  • gender - String
    • default: ''
    • if left empty -> response will contain all brands
// to get all brands
AlgoliaSDK.getBrands();

// to get specific gender brand
AlgoliaSDK.getBrands('Women');

Response: brands-data.json

GetPDP

Returns a product's details for the given SKU.

getPDP(params);
  • params - Object
    • sku - String: product's sku
      • default: ''
    • highlights - Array: list of attributes to highlight
      • if not set, all searchable attributes are highlighted
      • response contains highlighted_attributes attribute which contains the list of highlighted attributes
AlgoliaSDK.getPDP({
  sku: 'VAMTFRYIH-BLACK',
  highlights: ['brand_name', 'color', 'gender']
});

Response: pdp-data.json

GetPLP

Returns products for a PLP Screen.

getPLP(URL);
  • URL - String: URL for the Product list

URL Params & Structure:

  • params in URL should have the following form:

    /...?key=value&key=value1,value2,value3

  • custom params:

    • all the Algolia facet filters (q - query param, brand_name - Brands param, categories.levelX - categories param, categories_without_path etc.)
    • example 1: brand_name=Adidas,Aldo,Nike
    • example 2: categories.level0=Women
    • example 3: categories.level1=Women /// Shoes
    • example 4: categories.level2=Women /// Shoes /// Sandals
    • example 5: categories.level1=Men /// Shirts,Women /// Shoes
  • special params:

    • gender - mandatory = ENUM('Women', 'Men', 'Kids')
    • locale - mandatory = ENUM('en-ae', 'ar-ae', 'en-sa', 'ar-sa', 'en-kw', 'ar-kw', 'en-qa', 'ar-qa', 'en-om', 'ar-om', 'en-bh', 'ar-bh')
    • sort = String: ENUM('recommended', price_low', 'price_high', 'discount')
      • 'recommended' - default sorting
      • 'price_low'' - sort products by price ASC
      • 'price_high'' - sort products by price DESC
      • 'discount'' - sort products by highest discount
    • price.[currency].default - filter products by price
      • example 1: price.AED.default=gte50,lte700 - filter products with the price in interval >= 50 AED and <= 700 AED
      • example 2: price.SAR.default=lt100 - filter products with the price less than 100 SAR
    • discount - filter products by discount
      • example 1: discount=gt20,lte70 - filter products with the discount in range > 20% and <= 70%
      • example 2: discount=gte40 - filter products with the discount >= 40%

Notes: for price and discount key filters, instead of (>, <, >=, <=) symbols you should use the following:

  • 'lt' : <
  • 'lte' : <=
  • 'gt' : >
  • 'gte' : >=
  • 'eq' : =

We cannot use operators because will interfere with the query params in a URL

AlgoliaSDK.getPLP(
  '/women/outlet.html?q=Women%20Outlet&page=0&brand_name=Adidas,Aldo&categories.level0=Women&categories.level1=Women /// Shoes&discount=gt20,lte900&price.AED.default=gte50,lte1500&visibility_catalog=1&gender=Women&locale=en-ae'
);

Response: plp-data.json

GetPopularBrands

Returns popular brands.

getPopularBrands(limit);
  • limit - Int: results limit
    • default: 10
AlgoliaSDK.getPopularBrands(5);

Response

{
  "data": ["Adidas", "Aldo", "Adidas Originals", "Charles & Keith", "Nike"]
}

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 27

Native requirements
27 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
i18n-js
Environment
{
  "local_name": "i18n-js",
  "alias": false,
  "peer_metadata": null
}
^3.5.1runtime
url-parse
Environment
{
  "local_name": "url-parse",
  "alias": false,
  "peer_metadata": null
}
^1.4.7runtime
node-fetch
Environment
{
  "local_name": "node-fetch",
  "alias": false,
  "peer_metadata": null
}
^2.6.0runtime
algoliasearch
Environment
{
  "local_name": "algoliasearch",
  "alias": false,
  "peer_metadata": null
}
^4.17.1runtime
jest
Environment
{
  "local_name": "jest",
  "alias": false,
  "peer_metadata": null
}
^24.9.0development
husky
Environment
{
  "local_name": "husky",
  "alias": false,
  "peer_metadata": null
}
^2.5.0development
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
^5.16.0development
webpack
Environment
{
  "local_name": "webpack",
  "alias": false,
  "peer_metadata": null
}
^4.41.2development
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
^1.19.1development
@babel/cli
Environment
{
  "local_name": "@babel/cli",
  "alias": false,
  "peer_metadata": null
}
^7.7.4development
@babel/core
Environment
{
  "local_name": "@babel/core",
  "alias": false,
  "peer_metadata": null
}
^7.7.4development
lint-staged
Environment
{
  "local_name": "lint-staged",
  "alias": false,
  "peer_metadata": null
}
^10.0.7development
npm-run-all
Environment
{
  "local_name": "npm-run-all",
  "alias": false,
  "peer_metadata": null
}
^4.1.5development
webpack-cli
Environment
{
  "local_name": "webpack-cli",
  "alias": false,
  "peer_metadata": null
}
^3.3.10development
babel-eslint
Environment
{
  "local_name": "babel-eslint",
  "alias": false,
  "peer_metadata": null
}
^10.0.3development
babel-loader
Environment
{
  "local_name": "babel-loader",
  "alias": false,
  "peer_metadata": null
}
^8.0.6development
@babel/runtime
Environment
{
  "local_name": "@babel/runtime",
  "alias": false,
  "peer_metadata": null
}
^7.7.4development
@babel/polyfill
Environment
{
  "local_name": "@babel/polyfill",
  "alias": false,
  "peer_metadata": null
}
^7.7.0development
@babel/preset-env
Environment
{
  "local_name": "@babel/preset-env",
  "alias": false,
  "peer_metadata": null
}
^7.7.4development
eslint-plugin-jest
Environment
{
  "local_name": "eslint-plugin-jest",
  "alias": false,
  "peer_metadata": null
}
^23.20.0development
webpack-dev-server
Environment
{
  "local_name": "webpack-dev-server",
  "alias": false,
  "peer_metadata": null
}
^3.9.0development
eslint-config-airbnb
Environment
{
  "local_name": "eslint-config-airbnb",
  "alias": false,
  "peer_metadata": null
}
^18.0.1development
eslint-config-prettier
Environment
{
  "local_name": "eslint-config-prettier",
  "alias": false,
  "peer_metadata": null
}
^6.7.0development
eslint-plugin-jsx-a11y
Environment
{
  "local_name": "eslint-plugin-jsx-a11y",
  "alias": false,
  "peer_metadata": null
}
^6.3.1development
uglifyjs-webpack-plugin
Environment
{
  "local_name": "uglifyjs-webpack-plugin",
  "alias": false,
  "peer_metadata": null
}
^2.2.0development
@babel/plugin-transform-runtime
Environment
{
  "local_name": "@babel/plugin-transform-runtime",
  "alias": false,
  "peer_metadata": null
}
^7.7.4development
@babel/plugin-proposal-optional-chaining
Environment
{
  "local_name": "@babel/plugin-proposal-optional-chaining",
  "alias": false,
  "peer_metadata": null
}
^7.9.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "be6bed10407591b0510fb223bd997ddf0e34d02d",
  "tarball": "https://registry.npmjs.org/6thstreet-algolia-sdk/-/6thstreet-algolia-sdk-0.0.1.tgz",
  "fileCount": 38,
  "integrity": "sha512-OyD3DeVQMRCjAPX/n+DMKqlqVzm1B4pUSA5h0wH7z2te11Uj+kalNDYVr/RzCLaHY3y+kyCQ/ud4BWoYC9KrPw==",
  "signatures": [
    {
      "sig": "MEUCIQDXlnXyk/4anErOxJP3ZXtIDjUKarDIde9z6RhSZMD+lwIgE4jD/H4M+jVuleoLySb4L0oxjeU1CynK6WOsl3s4WGw=",
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
    }
  ],
  "unpackedSize": 210730
}

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:55 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:f643dd142ba1657e52111956ccc1dbfb412e2cc9bc6d7fb5fccca76bd50259fb

Other collected versions

0.0.2-beta-924 Sept0.0.2-beta-87 Sept0.0.2-beta-727 Aug0.0.2-beta-626 Aug0.0.2-beta-526 Aug0.0.2-beta-426 AugView all collected versions →