Skip to content

Script

Script vals are free form JavaScript, TypeScript, or JSX. They are useful for testing, saving utility functions, and one-off operations.

It’s common to use script vals to write standalone functions that can be imported by your HTTP, Scheduled, and Email vals. A script val can be as simple as a function that just adds two numbers:

export function add(a: number, b: number) {
return a + b;
}

Script vals can also export static values: they don’t need to export functions.

export const MEANING_OF_LIFE = 42;