Custom Types (Structures)

> Define your own data types to use across routes and functions.

Structures are custom data types you create in Brickr. They define a specific shape of data with named fields and types -- similar to a class or struct in programming languages.

Why use structures

  • Consistency -- Ensure the same data shape is used across multiple routes and functions.
  • Clarity -- Named fields with types make your flows easier to understand.
  • Validation -- The type system checks that connections between nodes match your structure definition.

Creating a structure

1. Navigate to Dashboard > Types or open the type picker in the Builder. 2. Click Create Structure. 3. Enter a name using PascalCase (e.g., UserProfile, OrderItem). 4. Optionally add a description. 5. Add fields with a name and type for each. 6. Click Create.

Example: UserProfile structure

| Field | Type | |-------|------| | name | String | | email | String | | age | Number | | isActive | Boolean |

Using structures in flows

Once created, your structure appears as a type option wherever you can select types -- function inputs, function outputs, and node pin configurations.

In functions

Define a function input as your custom structure type. When someone calls the function, they must pass an object that matches the structure.

With object nodes

Use Create Object or Split Object nodes to build and destructure values that match your structure.

Structure names must be PascalCase (starting with an uppercase letter, e.g., OrderData). This naming convention keeps custom types visually distinct from built-in types.

Available field types

Each field in a structure can be one of:

| Type | Description | |------|-------------| | String | Text values | | Number | Numeric values | | Boolean | True/false values | | Object | Nested object |

What's next?

| Topic | Description | |-------|-------------| | Type System Introduction | Overview of Brickr's type system | | Objects & Structs | Working with objects in flows | | Functions | Use structures as function inputs and outputs |