Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CONSUMER_ID=
KEY_VERSION=
PRIVATEY_KEY=
PASS_PHARSE=
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
env
.idea
env
.idea
.env
node_modules/
38 changes: 17 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


### Tested on Node
**v12.18.3**
**v16.15.0**
### This Repo is for NODE only DO NOT USE THIS FOR FRONTEND APPLICATIONS
While technically you could replace the crypto package this repo uses with one that is compatible with the front-end. This is a really bad idea! Private keys should not be put on a front end. They are **PRIVATE** for a reason!

Expand All @@ -26,18 +26,17 @@ This repo requires additional setup within node_modules
npm i node_walmartio
```

### Next navigate to /node_modules/node_walmartio/src
*You must fill out the details at the top of the page*
### Next copy/rename .env.example to .env and fill in the variables
*You must fill out the variables for this library to work*

```
let details = {
consumerId: "", <- Find on walmart dashboard after uploading your public key
keyVersion:"", <- See Above^
privateKey: ``, <- You must pass the encrypted private key. See below for more information
passPhrase:"" <- The passphrase which was used in the generation of the private key
}
CONSUMER_ID= <- Find on walmart dashboard after uploading your public key
KEY_VERSION= <- See Above^
PRIVATEY_KEY= <- You must pass the encrypted private key. See below for more information
PASS_PHARSE= <- The passphrase which was used in the generation of the private key
```
When you commit//clone your repo remember that node_modules will be cleaned. This might be seen as an annoyance but it will help ensure you dont accidently make your private key public.

When you commit//clone your repo remember that .env is not tracked for security reasons. This might be seen as an annoyance but it will help ensure you dont accidently make your private key public.

# IMPORTANT
Once you upload your public key onto the walmart dashboard there seems to be some amount of time that must pass before you can use it. If youre getting responses similar to
Expand All @@ -49,25 +48,25 @@ That normally means youre good to go, Just need to wait. I'm still not sure the
# Usage
Here is the basic usage of this repo
```
const walmart = require("node_walmartio");
const url = "https://developer.api.walmart.com/api-proxy/service/affil/product/v2/items";
const walmart = require("walmartio-js")
const url = "https://developer.api.walmart.com/api-proxy/service/affil/product/v2/items"
const query = "upc=035000521019"
const method = "GET";
const method = "GET"


const cb = (res) => {
console.log(res)
}
walmart(cb, url, method, null, query );
walmart.makeRequest(cb, url, query, null, method)
```

# Methods
Currently theres only one method and it is the default export of this repository. This will likely change in the future
Currently there is only one method "makeRequest". This will likely change in the future

# Parameters
Currently theres 4 parameters and only three are required. The order in which they are passed is important.
Currently there are 4 parameters and only three are required. The order in which they are passed is important.
``
walmart(callback, url, method, body, query)
walmart.makeRequest(callback, url, query, null, method)
``

**``callback``** <- This is a callback which returns the response of the query. This is included as the first parameter for use with Jering Techs Node Wrapper **REQUIRED**
Expand Down Expand Up @@ -126,7 +125,4 @@ const hashList = {
};
```

Walmart seems like they're undergoing some changes so I don't really expect this to work for too long. If you see issues please feel free to post in the issue or submit PRs.



Walmart seems like they're undergoing some changes so I don't really expect this to work for too long. If you see issues please feel free to post in the issue or submit PRs.
11 changes: 11 additions & 0 deletions examples/examples.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const walmart = require("../src/src"); //WHEN USING NPN THIS SHOULD BE THE PACKAGE NAME
const url = "https://developer.api.walmart.com/api-proxy/service/affil/product/v2/items";
const query = "upc=035000521019"
const method = "GET";


const cb = (res) => {
console.log(res)
}

walmart.makeRequest(cb, url, query, null, method);
272 changes: 0 additions & 272 deletions node_modules/node-fetch/CHANGELOG.md

This file was deleted.

Loading