@@ -72,18 +72,44 @@ yarn add brokerbin
72
72
73
73
74
74
``` js
75
- const BrokerBin = require (" brokerbin" )
75
+ const BrokerBin = require (" brokerbin" );
76
76
77
77
(async () => {
78
- const bbClient = new BrokerBin ()
78
+
79
+ // Initialize the BrokerBin
80
+ const bbClient = new BrokerBin ({
81
+ username: process .env .BROKERBIN_USERNAME
82
+ , password: process .env .BROKERBIN_PASSWORD
83
+ , soap_key: process .env .BROKERBIN_SOAP_KEY
84
+ , soap_uri: process .env .BROKERBIN_SOAP_URI
85
+ , public_key: process .env .BROKERBIN_PUBLIC_KEY
86
+ })
87
+
88
+ // Authenticate
79
89
await bbClient .authenticate ()
80
- const results = await bbClient .search (" ..." , {
90
+
91
+ // Run a search
92
+ const results = await bbClient .search (" F238F" , {
81
93
max_resultset: 50
82
94
, search_type: " partkey"
83
95
, sort_order: " ASC"
84
96
, sort_by: " price"
85
97
})
98
+
99
+ // Output the result
86
100
console .log (results)
101
+ // =>
102
+ // [ { company: '...',
103
+ // country: 'GBR',
104
+ // part: 'F238FNS',
105
+ // mfg: 'DELL',
106
+ // cond: 'REF',
107
+ // price: '...',
108
+ // qty: '4',
109
+ // age: '0',
110
+ // description: 'Dell 3.5" SAS Tray Caddy R710 R610 R410 T610 - No Screws',
111
+ // clei: '',
112
+ // status: '2' }, ... ]
87
113
})()
88
114
```
89
115
@@ -113,16 +139,17 @@ There are few ways to get help:
113
139
## :memo : Documentation
114
140
115
141
116
- ### ` brokerbin(auth, {} ) `
142
+ ### ` brokerbin(auth) `
117
143
BrokerBin API wrapper for Node.js
118
144
119
145
#### Params
120
146
121
147
- ** Object** ` auth ` : An object containing the following data:
122
148
- ` username ` (String): The BrokerBin username.
123
149
- ` password ` (String): The BrokerBin password.
124
- - ` soapkey ` (String): The BrokerBin soap key.
125
- - *** * ` {} ` : Param descrpition.
150
+ - ` soap_key ` (String): The BrokerBin soap key.
151
+ - ` soap_uri ` (String): The BrokerBin soap uri.
152
+ - ` public_key ` (String): The BrokerBin public key.
126
153
127
154
#### Return
128
155
- ** Number** Return description.
0 commit comments