CMS Development

AMorina
Participant

Access HubDB in ReactJS module

Résolue

Hi Devs. We have stored some data in HubDB. I wanted to access those data and use them in a ReactJs Module for Hubspot, since I need to implement some complex logic there. Unfortunately, we are running on professional license and we don't have access to serverless functions to achieve this, given that sls functions are only available for Enterprise. Can someone help me regarding this?

0 Votes
1 Solution acceptée
nikodev
Solution
Contributeur de premier rang | Partenaire solutions Elite
Contributeur de premier rang | Partenaire solutions Elite

Access HubDB in ReactJS module

Résolue

Hey there - @Jaycee_Lewis is right, if you need to access it via API. You'll have to use one of the numerous serverless services in order to do so. I've used Cyclic in the past, when I wanted to get something up and running quickly. Easy to set up, performance is up to par, cost effective. 

There's also AWS Lambda, Azure, Google App Engine, Heroku - there are lots of em. 

However - HubSpot's modules have hubdb fields. Depending on the specifics at play here, you could use those fields to make the query in your module.html file, perhaps with the help of one of the hubl hubdb functions  and pass the data to your Component files as parameters. You could then do whatever you need to do with it there. If you can't just retrieve the data in bulk, or if the table that needs to be queried is going to differ based on some kind of user action on the front end...this avenue may not be the way. 

A8 Labs

Voir la solution dans l'envoi d'origine

3 Réponses
AMorina
Participant

Access HubDB in ReactJS module

Résolue

Thank you very much, I will try and use hubdb functions just to access the data and I'll try and grab them in my react app. Thanks again, this was very helpful.

0 Votes
nikodev
Solution
Contributeur de premier rang | Partenaire solutions Elite
Contributeur de premier rang | Partenaire solutions Elite

Access HubDB in ReactJS module

Résolue

Hey there - @Jaycee_Lewis is right, if you need to access it via API. You'll have to use one of the numerous serverless services in order to do so. I've used Cyclic in the past, when I wanted to get something up and running quickly. Easy to set up, performance is up to par, cost effective. 

There's also AWS Lambda, Azure, Google App Engine, Heroku - there are lots of em. 

However - HubSpot's modules have hubdb fields. Depending on the specifics at play here, you could use those fields to make the query in your module.html file, perhaps with the help of one of the hubl hubdb functions  and pass the data to your Component files as parameters. You could then do whatever you need to do with it there. If you can't just retrieve the data in bulk, or if the table that needs to be queried is going to differ based on some kind of user action on the front end...this avenue may not be the way. 

A8 Labs

Jaycee_Lewis
Gestionnaire de communauté
Gestionnaire de communauté

Access HubDB in ReactJS module

Résolue

Hi, @AMorina 👋 It's a great question and definitely an interesting challenge to do without access to serverless functions. My gut says some middleware will be needed. And let's ask some of our brilliant community members for their thoughts — hey @Mike_Eastwood @nikodev @JBeatty what you say to a client in this situation? 

 

Thank you so much! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot