Constants & Secrets

"Constants" are used for unchanging data in code to enhance readability and maintainability, "Secrets" refer to sensitive information that should be protected and not exposed in your code.

Creating Constants

Constants

Constants within our app are asset functions that are leveraged to use values that do not change during the execution of a program. They are typically used to represent fixed, unchanging data in code, making it easier to manage and understand.

Importing constants into Canvas

Adding Constants

You can attach any asset to a canvas by following the procedure above.

In canvas, the constants are often used as imports within libraries to make commonly used values available to users of the library in a convenient and consistent way.

Creating Secret Constants

Secret Constants

Secret constants are essential for accessing sensitive data such as API keys, passwords, access tokens and other confidential data that a program or application needs for execution. This can be easily achieved by using "make secret" or "Secret" option while or after creating the constant.

Hiding Secret Key

Secrets within asset function can utilize anonymization of the confidential data in canvas for seamless coding experience among team members in an organization.

Last updated