APIs & Integrations

RobertMarinho
Participante

Getting APIKEY undefined on serverless functions via process.env (Loca

resolver

Hello all,

I´m not able to get theprocess.env.APIKEY on serverless functions locally.

 

I´ve added the APIKEY through hs secrets add command:

RobertMarinho_1-1633097838909.png

After running the local server secrets env are all set:

RobertMarinho_2-1633098579812.png

 

On the code I´m loggin the APIKEY and the API response to some request:
RobertMarinho_4-1633099334848.png

 

Since APIKEY is undefined the hapikey is not present in the query params.
That´s the result I get:
RobertMarinho_3-1633098872219.png

 

Anyone also having this issue?

Thanks,

 

 

0 Me gusta
2 Soluciones aceptadas
RobertMarinho
Solución
Participante

Getting APIKEY undefined on serverless functions via process.env (Loca

resolver

@dennisedson 

I´m not having issues with this anymore.

I´m wondering If It was just a problem on my end.

I´ve updated @hubspot/cli from 3.0.8 to 3.0.9. and It started working again.

Thanks,

 

Ver la solución en mensaje original publicado

AChong6
Solución
Participante

Getting APIKEY undefined on serverless functions via process.env (Loca

resolver

For others, be sure to CAPITALIZE your environment variable names and you can also find the secret in the context parameter of exports.main, if process.env is not working for you. 

Ver la solución en mensaje original publicado

5 Respuestas 5
RobertMarinho
Participante

Getting APIKEY undefined on serverless functions via process.env (Loca

resolver

lol 😂 Never watched It. That was funny.

Thanks for sharing!

RobertMarinho
Solución
Participante

Getting APIKEY undefined on serverless functions via process.env (Loca

resolver

@dennisedson 

I´m not having issues with this anymore.

I´m wondering If It was just a problem on my end.

I´ve updated @hubspot/cli from 3.0.8 to 3.0.9. and It started working again.

Thanks,

 

AChong6
Solución
Participante

Getting APIKEY undefined on serverless functions via process.env (Loca

resolver

For others, be sure to CAPITALIZE your environment variable names and you can also find the secret in the context parameter of exports.main, if process.env is not working for you. 

dennisedson
Equipo de producto de HubSpot
Equipo de producto de HubSpot

Getting APIKEY undefined on serverless functions via process.env (Loca

resolver

@RobertMarinho ever watch the IT crowd? 🤣

https://youtu.be/nn2FB1P_Mn8?t=11

0 Me gusta
dennisedson
Equipo de producto de HubSpot
Equipo de producto de HubSpot

Getting APIKEY undefined on serverless functions via process.env (Loca

resolver

@RobertMarinho ,

Are you still having issues with this?

0 Me gusta