Share Your Work

BorisV
Member | Elite Partner
Member | Elite Partner

Introduction

Hi all - I work on the integration side of things for https://struto.io , mostly developing middleware, but also dealing with custom-coded workflows and serverless functions. I am also quite active in our pre-sales activities.

So far, I have been largely a lurker in the community forums, but now I faced a particular issue related to default JS client library made available to serverless functions - it is version 1.0 - beta (NPM is on 8.4.x) and it excludes methods dealing with custom objects.

How the version was corroborated:

const hubspot = require('@hubspot/api-client')
const hubspotClient = new hubspot.Client({accessToken: PA_TOKEN });
library = hubspotClient.crm
sendResponse({ body: library, statusCode: 200 })


Workaround:

I will use Axios and generic HTTPS calls to achieve objective.

I use webpack normally to compile the code for serverless functions (for example, on another project, we had a QR code generation requirement that needed external lib), but here, as I just need a simple search involving a custom object, already included Axios lib would do.

Hubspot community really helped me in the past and I am at the stage now where I would like to give some back.




 

1 Reply 1
Jaycee_Lewis
Community Manager
Community Manager

Introduction

Hey, @BorisV 👋 Welcome to the community. We're so glad you are here 😊

 

Please let us know how we can support you in your HubSpot journey!

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes