Using library from a Cloud hosted function
See original GitHub issueHi! I’m trying to use the lib from a Node.js hosted function but since it’s a limited environment, some tests are failing, especially in regard to the UserAgent which can’t be written since the lib can’t read the package.json file.
So I get a warning: Could not load package details
. The user agent is set to 'User-Agent': 'nexmo-node/UNKNOWN node/UNKNOWN
And I think that’s why I get HTTP 401 error when I want to query the service from a Function while it works on my local machine.
If that’s the case how can I bypass this behavior? Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Cloud Functions client libraries
This page shows how to get started with the Cloud Client Libraries for the Cloud Functions API.
Read more >Google Cloud Functions include private library - Stack Overflow
I'm looking to write a custom library in node and I'd like to include that with my Cloud Functions. Since this is shared...
Read more >Use Libraries to Manage Integration Functions
JavaScript libraries provide a means to create and organize JavaScript for use in integrations. Library functions are automatically available for you to ...
Read more >Handling dependencies | Cloud Functions for Firebase - Google
A function is allowed to use external Node.js modules as well as local data. Dependencies in Node.js are managed with npm and expressed...
Read more >Cloud Functions for Firebase Sample Library - GitHub
This quickstart sample demonstrates using Cloud Functions triggered by Firebase Realtime Database or Firestore events. The function transforms message text ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It really doesn’t, we’re using the User-Agent to segment usage, not really blocking anything. I still haven’t figured out how to access the package.json in a serverless environment, so I can have consistency.
However my remark regarding User-Agent is still valid: it does not work in that environment. But it seems it really does not matter.