Razz21 / bc-product-search-proxy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Amplience Dynamic Content

Bigcommerce Product Search Proxy Server

This project creates a proxy server that is meant to be used with dc-extension-product-selector.

Netlify Status

Deploy to Netlify

Deploy witt Vercel


Development with Netlify

Run locally in developer mode, app automatically rebuilds the app when changes are made.

$ npm install -g netlify-cli
$ netlify dev

Development with Vercel

Run locally in developer mode, app automatically rebuilds the app when changes are made.

$ npm install -g vercel
$ vercel dev

Request Parameters

Product Search

Parameter Type Description
search_text String Required text based search parameter
limit Int Required Page limt per page
page Int Required Item return page

request example;

type; POST
endpoint; /product-search
headers;
    Content-Type; application/json
    X-Auth-Token; {AUTH-TOKEN}
    store-hash; {STORE-ID}
    api-version; {API-VERSION}
body;
    {
      "search_text": "shoe",
      "limit": 20,
      "page": 0
    }

Get Products by Ids

Parameter Type Description
ids String Required Ids separated by comma (,)

request example;

type; GET
endpoint; /products
params;
    ids=120,121
headers;
    Content-Type; application/json
    X-Auth-Token; {AUTH-TOKEN}
    store-hash; {STORE-ID}
    api-version; {API-VERSION}

http://localhost:3000/products?ids=120,121

Extension Example

"ui:extension": {
    "url": "http://localhost:3000/",
    "params": {
        "proxyUrl": {The URL of the proxy service},
        "storeHash": {STORE-ID},
        "accessToken": {AUTH-TOKEN},
        "apiVersion": 'v3'
    }
}

About

License:Apache License 2.0


Languages

Language:TypeScript 99.6%Language:HTML 0.4%