How to manage re-used settings used across Cloud Code data & functions?

3 posts, 0 answers
  1. ptw
    ptw avatar
    27 posts
    Member since:
    Sep 2015

    Posted 16 Mar Link to this post

    Anyone know if there is a nice way to store (and access) settings that are re-used across back-end functions?

    For example, say you have several functions accessing an external API with the same API Key and credentials. Hard-coding the credentials (and other similar settings) into every function seems messy ...and time consuming if they need to be changed. Perhaps a file that contains a Javascript object of the settings, and that is called/included at the start of backend data and functions.

    Any ideas? Thanks.

     

  2. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 18 Mar Link to this post

    Hi,

    Thanks for posting to the Telerik Developer Forums.

    Indeed this would be a nice addition to the Business Logic layer. We have some ideas in our backlog about adding capabilities for easy code reuse and management in the cloud code/cloud functions. Currently we cannot commit to a particular time-frame for the actual implementation though.

    At the current stage the easiest way to accomplish this is to have the credentials and settings in just one function and call this function with parameters from the other places in the cloud code layer.

    Let me know should you have further questions or considerations.

    Regards,
    Anton Dobrev
    Telerik
     
    Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
     
  3. Matt
    Matt avatar
    17 posts
    Member since:
    Jun 2015

    Posted 26 Jul Link to this post

    Hey, probably late to this response...

     

    we had the exact need (a custom guid we need to store used across multiple cloud functions).  i used a cloud data table and using everlive.sdk referenced a field from all my functions.  this was easier to edit for us as it's a data field (vs. getting into the code).  we actually set up two apps, a 'Dev' and a 'Live' which have different app-ids.  in our code, we just change the app-id reference to get to the different cloud functions -- that way i can experiment with cloud code an not mess up my live environment.  also gives me a different data table with dev-settings/properties than my live data-table and properties.

     

    has worked very well for our needs.  hope it helps give you ideas!

    Matt

Back to Top