Variables
Secure storage for API keys and other information
The variables API allows you to store information like API keys securely and access them from your Repeat.
Examples
Adding a new variable
On the sidebar of your Repeat, click on the Variables tab.
Here, you’ll be able to enter a Key which is the name of the variable as well as the value.
The Encrypt checkbox allows you to mask the value in the Repeat dashboard.
![Notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F7119b653-ea41-4095-aec2-85e4fc093a27%2FUntitled.png?table=block&id=d3c82ceb-0def-4cd9-8eb3-330ddfd76432&cache=v2)
Accessing variables
Once you’ve added a variable to your Repeat, you can then access through env.variables
.
export default {
async webhook(request: Request, env: Repeat.Env) {
console.log(env.variables.FOO);
},
};
![Notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fe97a821a-f48a-468d-b3f0-7d62ca9071ce%2FUntitled.png?table=block&id=80b3744b-650f-49b1-98eb-4832a8ef7cd3&cache=v2)
Last updated on November 11, 2022