Trapeze is part of the Ionic Ecosystem →
Skip to main content

Getting Started

To configure projects using Trapeze's configuration-driven experience, install the @trapezedev/configure package.

npm install @trapezedev/configure

For Android: Java must be on PATH or JAVA_HOME must be set to use Gradle operations. This is because the Gradle modification functionality uses a Java utility under the hood for accuracy, as Gradle is a Groovy DSL and Groovy is a JVM language. If you have Android Studio installed, you can use the JDK bundled with it. Note: JAVA_HOME should be set to the root of the JDK installation, not the /bin folder.


Then, assuming you have a Trapeze YAML configuration file to use, use the run command to process it.

npx trapeze run config.yaml --android-project android --ios-project ios/App

Where --android-project is the relative path to your Android project, and --ios-project is the relative path to your iOS Xcode project folder.

Here's a basic example YAML file:

versionName: 5.2.1
version: 16.4

Changes can be previewed using the --diff flag to see a unified diff of the changes to each file.

Writing Configuration Files

Configuration files are written in YAML. New to YAML? Read Learn YAML in five minutes.

See an Example Yaml Configuration for a real-world example using many of the supported features.

Variables and Environment Variables

Variables defined in the yaml vars section can be automatically supplied through environment variables of the same name, or interactively input by the user if not found in the environment and lacking a default value.

For example:

default: true

In this case, MY_APP_ID has no default value, so MY_APP_ID must be found in the environment or an interactive prompt will display asking the user to input a value. THIS_HAS_A_DEFAULT will use the default value of true unless a value is provided in the environment.

Here's one example of providing an environment variable to the command:

MY_APP_ID="" npx trapeze

JSON Variables

Variables can be strings or any JSON-parsable value. This makes them capable of being used for more complex configuration. Additionally, variable substitution also applies to any JSON values so references to other variables can be made:


- keychain-access-groups: $KEYCHAIN_GROUPS

Variable types

Since: 7.0.3

Since environment variables are always strings, values that are meant to be numbers can be incorrectly processed. To specify the exact type a variable must have, use the type field when defining variables:

type: number

The supported types are string, number, array, and object.

string values will be consumed as-is, number values will be passed through parseInt(v, 10), and both array and object will be passed through JSON.parse(v).

Next steps

Follow the Android, iOS, and Project-level guides to see the full set of operations available for each platform.