ReferenceError: fetch is not defined
at requestFinAttestKey (/home/federico/evogy/haystack/auth/node_modules/haystack-nclient/dist/index.js:328:18)
at getAttestKey (/home/federico/evogy/haystack/auth/node_modules/haystack-nclient/dist/index.js:348:19)
at addAttestKeyHeader (/home/federico/evogy/haystack/auth/node_modules/haystack-nclient/dist/index.js:387:33)
at finCsrfFetch (/home/federico/evogy/haystack/auth/node_modules/haystack-nclient/dist/index.js:400:15)
at fetchVal (/home/federico/evogy/haystack/auth/node_modules/haystack-nclient/dist/index.js:654:26)
at OpsService.invokeOp (/home/federico/evogy/haystack/auth/node_modules/haystack-nclient/dist/index.js:3162:16)
at OpsService.read (/home/federico/evogy/haystack/auth/node_modules/haystack-nclient/dist/index.js:3178:25)
at Object.<anonymous> (/home/federico/evogy/haystack/auth/index.js:17:25)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
Code is very simple
var { Client } = require('haystack-nclient')
// Explicitly define what project to use...
let client = new Client({
base: new URL("url"),
project: 'demo',
authBearer: '***'
});
const grid = client.ops.read('site')
.then(value => console.log(value))
.catch(error => console.log(error));
Trying to use the client I recevice this error
Code is very simple
package.json
npm version 8.5.1 node version 14.19.0