# Secure location to store api key in custom theme

**URL:** <https://community.hubspot.com/t/secure-location-to-store-api-key-in-custom-theme/21727>\
**Category:** CMS Development\
**Created:** [June 15, 2020, 10:05pm UTC](https://community.hubspot.com/t/secure-location-to-store-api-key-in-custom-theme/21727 "2020-06-15T22:05:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidFJones](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/davidfjones/32/75439_2.png) [@DavidFJones](https://community.hubspot.com/u/DavidFJones)\
**Post date:** [June 15, 2020, 10:05pm UTC](https://community.hubspot.com/t/secure-location-to-store-api-key-in-custom-theme/21727/1 "2020-06-15T22:05:47Z")

</div>

Hello,  
I am currently working on a custom theme using the hubspot cms. In this theme users will have tasks they complete, with their progress for each task being stored as a property in their contact record. Something that this theme needs to do is dynmically populate these user properties based on the tasks.  
So if a person using this theme creates a new task, the system will need to check if the contact has a property for that task, and if so update it/if not, create it.  
My question is what would be best practice for storing the api key? I using these guides as a reference on creating new properties/updating them based on specific user actions - [https://developers.hubspot.com/docs/methods/contacts/v2/create\_contacts\_property](https://developers.hubspot.com/docs/methods/contacts/v2/create_contacts_property)  
[https://developers.hubspot.com/docs/methods/contacts/v2/update\_contact\_property](https://developers.hubspot.com/docs/methods/contacts/v2/update_contact_property)  
Thanks

---

<div class="post-metadata">

**Author:** ![stefen](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stefen/32/29274_2.png) [@stefen](https://community.hubspot.com/u/stefen)\
**Post date:** [June 17, 2020, 3:02pm UTC](https://community.hubspot.com/t/secure-location-to-store-api-key-in-custom-theme/21727/2 "2020-06-17T15:02:47Z")

</div>

@DavidFJones you could store it in a HubL variable and it should be safe from the public. However, anyone that has access to the design manager would be able to easily find it. I don’t know if you can even really do anything with a HubSpot API from within a HubSpot theme anyway just because you can’t do a server side POST request as far as I know besides just using a normal HubSpot form or running your own server. Anyway, hope that helps.

---

<div class="post-metadata">

**Author:** ![DavidFJones](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/davidfjones/32/75439_2.png) [@DavidFJones](https://community.hubspot.com/u/DavidFJones)\
**Post date:** [June 17, 2020, 3:33pm UTC](https://community.hubspot.com/t/secure-location-to-store-api-key-in-custom-theme/21727/3 "2020-06-17T15:33:32Z")

</div>

So after seeing your response, and looking into the limitations a bit more what I want to be able to do with it will require the use of serverless functions to achieve the functionality I’m looking for.  
Thank you for the help.
