Socket
Socket
Sign inDemoInstall

@bloomreach/discovery-web-sdk

Package Overview
Dependencies
0
Maintainers
33
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @bloomreach/discovery-web-sdk

Welcome to the Bloomreach Discovery Web SDK, a TypeScript SDK designed to interact with the Bloomreach Discovery APIs. This SDK provides a convenient way to integrate and use the Discovery data in your applications.


Version published
Weekly downloads
53
increased by43.24%
Maintainers
33
Install size
32.3 kB
Created
Weekly downloads
 

Readme

Source

Bloomreach Discovery Web SDK

Welcome to the Bloomreach Discovery Web SDK, a TypeScript SDK designed to interact with the Bloomreach Discovery APIs. This SDK provides a convenient way to integrate and use the Discovery data in your applications.

Getting Started

First initialize the SDK by providing a set of account and product catalog specific options

import type { SetupConfiguration } from '@bloomreach/discovery-web-sdk';
import { initialize } from '@bloomreach/discovery-web-sdk';

// Set the account and catalog configuration
const config: SetupConfiguration = {
  account_id: 1234,
  domain_key: 'example_com',
};

// Initialize the SDK with the provided configuration
initialize(config);

Now we can utilize the exposed methods to retrieve data from the Bloomreach Discovery platform:

Product Search API

import type { ProductSearchOptions } from '@bloomreach/discovery-web-sdk';
import { productSearch } from '@bloomreach/discovery-web-sdk';

// Set up the search parameters
const searchOptions: ProductSearchOptions = {
  q: 'Generic Metal Pants',
};

// Retrieve the product data with a search using the provided search parameters
const data = await productSearch(searchOptions);

Category API

import type { CategorySearchOptions } from '@bloomreach/discovery-web-sdk';
import { categorySearch } from '@bloomreach/discovery-web-sdk';

// Set up the search parameters
const searchOptions: ProductSearchOptions = {
  q: 'cat92082',
};

// Retrieve the product data with a search using the provided search parameters
const data = await categorySearch(searchOptions);

Bestseller API

import type { BestsellerOptions } from '@bloomreach/discovery-web-sdk';
import { bestseller } from '@bloomreach/discovery-web-sdk';

// Set up the search parameters
const searchOptions: BestsellerOptions = {
  q: 'Bolts',
};

// Retrieve the product data with a search using the provided search parameters
const data = await bestseller(searchOptions);

Content Search API

import type { ContentSearchOptions } from '@bloomreach/discovery-web-sdk';
import { contentSearch } from '@bloomreach/discovery-web-sdk';

// Set up the search parameters
const searchOptions: ContentSearchOptions = {
  catalog_name: 'Flowers',
  q: 'Roses',
};

// Retrieve the Content data with a search using the provided search parameters
const data = await contentSearch(searchOptions);

Autosuggest API

import type { AutosuggestOptions } from '@bloomreach/discovery-web-sdk';
import { autosuggest } from '@bloomreach/discovery-web-sdk';

// Set up the search parameters
const searchOptions: AutosuggestOptions = {
  catalog_views: 'product:store1,store2|recipe:premium|articles',
  q: 'Roses',
};

// Retrieve the suggestions with a search using the provided search parameters
const data = await autosuggest(searchOptions);

Contributing

Contributions are welcome! Please read the contributing guidelines before getting started.

License

This project is licensed under the MIT License. See the LICENSE file for details.

FAQs

Last updated on 09 May 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc