Giter VIP home page Giter VIP logo

bigcommerce-algolia-connector's Introduction

What

Boilerplate serverless function connecting Bigcommerce to Algolia

What does this application do?

The application is using BigCommerce webhooks to send product data whenever a product is created, updated or deleted to a serverless function that send the data to Algolia

Contributing

George FitzGibbons

Running the project

To get started you will need to have a BigCommerce Store.

You will need to have +v10 node.

You will need Serverless


In this example the serverless.yml is configured for AWS.
https://serverless.com/framework/docs/providers/aws/guide/installation/

You can easily update the yml for your desired FAAS providers

You will need to generate BigCommerce API keys, these keys need to have read permissions for products.

In the serverless.yml file update the environment with your site API Keys

environment:
  STORE_HASH: {YOUR STORE HASH}
  BC_CLIENT: {YOUR CLIENT ID}
  BC_TOKEN: {YOUR TOKEN ID}
  ALGOLIA_APP_ID: { APP ID}
  ALGOLIA_API_KEY: {API KEY}

Now run to set up

npm install

Now you're ready to deploy

cd algolia
sls deploy

You will get an API endpoint back, you will use this when you set up your webhook.

endpoints:
  POST - https://{XXXXXX}.execute-api.us-east-1.amazonaws.com/dev/algolia

Now in postman create the webhook to send order created to endpoints https://developer.bigcommerce.com/api-docs/getting-started/webhooks/webhook-events#orders

curl --location --request POST 'https://api.bigcommerce.com/stores/{STORE HASH}/v2/hooks' \
--header 'X-Auth-Client: XXXXX' \
--header 'X-Auth-Token: YYYYYY' \
--data-raw '{
 "scope": "store/product/*",
 "destination": "https://ZZZZZ.execute-api.us-east-1.amazonaws.com/dev/algolia",
 "is_active": true
}'

bigcommerce-algolia-connector's People

Stargazers

 avatar

Watchers

 avatar  avatar

bigcommerce-algolia-connector's Issues

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.