I am attempting to use the apigee-access NPM module (v1.4.0) to read encrypted KVM values from a HostedTarget Node.js proxy. It would appear from the Apigee documentation that this should be possible ( https://docs.apigee.com/api-platform/nodejs/accessing-key-value-maps-nodejs ).
However, this code:
var apigee = require('apigee-access') var kvm = apigee.getKeyValueMap('kvmName', 'api', 'api-name') kvm.get('keyName', function (err, key_value) { console.log(key_value) })
is throwing this exception:
Error: KeyValueMap is not available in this versionError: Cannot find module 'apigee-internal-keyvaluemap'
Looking at the source for the module, it would appear that the Hosted node proxy environment is missing a dependency that is somehow already supposed to exist in the environment. The closest similar question I could find ( https://community.apigee.com/questions/19816/accessing-kvm-from-node-js.html ) hasn't been updated since 2017.
Answer by Jeremy Whitlock · Feb 28 at 03:57 AM
Hosted Targets does not support the apigee-access module, as documented here. There is documentation in the FAQ that should help you migrate away from apigee-access usage. Please let us know if we can help further.
Accessing KVM from node js 4 Answers
Is it possible to add other node.js modules in Apigee Edge? 2 Answers
Accessing KVM from JavaCallout 1 Answer
ES6 support via polyfill or transpiler 3 Answers
"Invalid cached data" on attempt to get cache entry 1 Answer