roboto-js 1.5.6 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client_test.js CHANGED
@@ -11,7 +11,7 @@ const roboto_password = creds.roboto.password;
11
11
 
12
12
  const { RobotoApi } = require('./src/index.js');
13
13
  const roboto = RobotoApi.configure({
14
- apiKey: process.env.ROBOTO_API_KEY,
14
+ accessKey: process.env.ROBOTO_API_KEY,
15
15
  baseUrl: process.env.ROBOTO_HOST
16
16
  });
17
17
 
@@ -38,7 +38,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
38
38
  var Roboto = exports["default"] = /*#__PURE__*/function () {
39
39
  function Roboto(_ref) {
40
40
  var host = _ref.host,
41
- apiKey = _ref.apiKey,
41
+ accessKey = _ref.accessKey,
42
42
  localStorageAdaptor = _ref.localStorageAdaptor;
43
43
  var proxyReq = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
44
44
  _classCallCheck(this, Roboto);
@@ -49,8 +49,8 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
49
49
  }
50
50
  var isBrowser = typeof window !== "undefined";
51
51
  this.config = {
52
- apiKey: apiKey,
53
- // Use passed apiKey
52
+ accessKey: accessKey,
53
+ // Use passed accessKey
54
54
  baseUrl: "https://".concat(host),
55
55
  // Use passed host
56
56
  localStorageAdaptor: localStorageAdaptor
@@ -63,10 +63,14 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
63
63
  if (proxyReq && proxyReq.headers) {
64
64
  var authtoken = proxyReq.headers.authtoken;
65
65
  var accesskey = proxyReq.headers.accesskey;
66
+ var apikey = proxyReq.headers.apikey;
66
67
  // Optionally add more headers as needed
67
68
  if (authtoken) {
68
69
  this.config.authtoken = authtoken; // Set the authtoken in the config
69
70
  }
71
+ if (apikey) {
72
+ this.config.apikey = apikey; // Set the authtoken in the config
73
+ }
70
74
  if (accesskey) {
71
75
  this.config.accesskey = accesskey; // Set the accesskey in the config
72
76
  }