Coder Social home page Coder Social logo

klevultd / frontend-sdk Goto Github PK

View Code? Open in Web Editor NEW
20.0 5.0 5.0 25.49 MB

Monorepository for Klevu headless

Home Page: https://www.klevu.com

License: MIT License

JavaScript 3.07% TypeScript 77.75% HTML 0.44% CSS 6.63% MDX 12.11%
typescript api-client headlessui ecommerce react remix-run search-engine ssr vue

frontend-sdk's People

Contributors

davidwarrington avatar dependabot[bot] avatar dhawalmodi avatar forgiveme avatar github-actions[bot] avatar jerrypena1 avatar klevu avatar nikhil-narayana-klevu avatar rallu avatar zellenka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

frontend-sdk's Issues

Search

Simple SDK to do search to Klevu API

Required features

  • Search
  • Pagination
  • Getting filters
  • Applying filters to search

Pagination should have easy to use API that takes caches and applies filters automatically for better performance.

Issue with requesting next results

Hi, there's a problem with next function's offset property, instead of adding the offset value as a number it gets appended as a string

view screenshots below:

Screenshot from 2022-05-28 22-44-46

Screenshot from 2022-05-28 22-45-06

Web component: Recommendation app

Recommendation web component pulls data from given KMC recommendation ID and it creates horizontal swiper component from products fetched by @klevu/core

It is preferred that no external UI libraries is used to create this component.

Required UI web component

Recommendations

Implement simple to use functions to get recommendations from the Klevu API

Category Navigation

Simple API to fetch data for category navigation.

Should implement helper function that fetches filters has ability to paginate category navigation fetches.

Filters are not reset while switching the categories (still happening)

When you enable a filter (say color: blue) and change to a different category, the blue filter is still selected.

There was a fix submitted, but after QA the same issue is still there.

In addition:

  • there seems to be a problem with the color swatch for "oliv". sometimes it's white, sometimes it burgundy, etc. My guess is that its having a hard time because it does not actually match a real color without the full spelling.
  • there seems to be a problem with the price slider filtering.

There are videos that show these issues in Jira.

Jira: KS-12397

Web component: Product component

A simple product component taking in KlevuRecord from @klevu/core and rendering a HTML output from that.

Component should be as extensible as possible so that developers can easily change the way it renders.

Create tools to work with filters

Create a tool that can take filters and handle their current selection. This model should be passable to search queries in order to make handling easier.

Move next() page function from upper level of results to individual query results

Currently calling next() page will automatically try to detect which of the queries should be paginated. That is not optimal way of it working.

We need to move next() to same level as sendEvent functions in the result so that developer explicitly selects which of the queries they wish get next page from.

Old function should be @deprecated in documentation and then removed in next version.

Can we add the boiler plate code for adding and removing KlevuDomEvents.FilterSelectionUpdate to core?

Instead of having add:

document.addEventListener(
    KlevuDomEvents.FilterSelectionUpdate,
    handleFilterUpdate
)

onBeforeRouteLeave((to, from, next) => {
    document.removeEventListener(
        KlevuDomEvents.FilterSelectionUpdate,
        handleFilterUpdate
    )
})

Could we do something like:

const removeFilterSelectionUpdate = KlevuDomEvents.addFilterSelectionUpdate(usersFilterUpdateHandler)

usersFilterUpdateHandler & removeFilterSelectionUpdate can be called anything, and this would allow the implementation to require less boiler plate.

Recommendation templates and banners.

Currently recommendations are created in Klevu Merchant Center and the data coming in is plain HTML and Javascript that should be injected using Klevu JSv2 library.

In milestone 1.0.0 we support only fetching recommendations through the API and KMC based builder is not available.
In milestone 2.0.0 we give a way to inject JSv2 into website and init these banners. Banners are loaded through the library.

After these in the next version we should build up provide JSON output from KMC that it's easier to build UI builder with any library.

Data formatter for incoming data

We need to clean and format incoming data. For example slider filter min/max values are coming in as string even though they are numbers in reality.

There are multiple cases this happens. There are also boolean values coming from API "true" or "false" strings.

Issue with Filters

Hi, we are using the @klevu-core v1.1.0 for the project, developed using React, as a dependency and we have a problem with filter options.

  1. issue with price range filters, we could not find the detailed info and examples for it. using the updateSlider, filters were sent in payload but in the result the values ( end and start ) were returning null and records were empty.
  2. the issue with filter toggle. filters get applied correctly and product records get updated, but the value ( selected ) isn't updated correctly, there are some issues with FilterManager. the same issue is noticeable on the demo page.

I wanted to ask for some suggestions or information about these issues if they are currently in development

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.