# Constants & Secrets

### Creating Constants

<figure><img src="https://1018070783-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIQKNeqjEeOp9UwUcB9R9%2Fuploads%2FbMDiIHDp7vxGl0DxeUeq%2FScreenshot%202025-06-19%20at%201.12.56%E2%80%AFPM.png?alt=media&#x26;token=7699f13b-3008-4e64-bfb4-10b8d0dfc5fb" alt=""><figcaption><p>Constants</p></figcaption></figure>

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

<figure><img src="https://1018070783-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIQKNeqjEeOp9UwUcB9R9%2Fuploads%2F0fqacLgnqfFhVTwgWXze%2FScreenshot%202025-11-27%20at%204.48.06%E2%80%AFPM.png?alt=media&#x26;token=a22bc0de-f047-4f09-a547-d2828b7637fd" alt=""><figcaption><p>Adding Constants</p></figcaption></figure>

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

<figure><img src="https://1018070783-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIQKNeqjEeOp9UwUcB9R9%2Fuploads%2FcRaYFaLiToiOd67nx54H%2FScreenshot%202025-11-27%20at%204.55.01%E2%80%AFPM.png?alt=media&#x26;token=852c49b9-a3dc-4ca8-9bb4-397c91b370ba" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://1018070783-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIQKNeqjEeOp9UwUcB9R9%2Fuploads%2FgCBlyYfgN93OTJdLK4Km%2FScreenshot%202025-06-19%20at%201.21.31%E2%80%AFPM.png?alt=media&#x26;token=c58c7255-6f56-4f25-a9f9-0d709142c284" alt=""><figcaption><p>Secret Constants</p></figcaption></figure>

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.

<figure><img src="https://1018070783-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIQKNeqjEeOp9UwUcB9R9%2Fuploads%2FvlIkvzXefxBmwGaAlJC0%2FScreenshot%202025-06-19%20at%201.21.48%E2%80%AFPM.png?alt=media&#x26;token=7c4f9e9c-272a-4b32-9b38-0e6d68935b7b" alt=""><figcaption><p>Hiding Secret Key</p></figcaption></figure>

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