Configuration
Configure your app with teardown.config.ts.
The teardown.config.ts file is the central configuration for your React Native app. It defines app metadata, platform settings, and plugins.
Basic Structure
import { defineConfig } from "@teardown/cli";
export default defineConfig({
name: "My App",
slug: "myapp",
version: "1.0.0",
ios: { ... },
android: { ... },
plugins: [ ... ],
navigation: { ... },
});Core Options
| Option | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name of the app |
slug | string | Yes | URL-safe identifier (used for deep links) |
version | string | Yes | Semantic version (e.g., "1.0.0") |
iOS Configuration
ios: {
bundleIdentifier: "com.example.myapp",
buildNumber: 1,
deploymentTarget: "15.0",
infoPlist: {
// Additional Info.plist entries
},
entitlements: {
// App entitlements
},
associatedDomains: ["applinks:myapp.com"],
}iOS Options
| Option | Type | Default | Description |
|---|---|---|---|
bundleIdentifier | string | Required | iOS bundle ID |
buildNumber | number | 1 | Build number for App Store |
deploymentTarget | string | "15.0" | Minimum iOS version |
infoPlist | object | {} | Additional Info.plist entries |
entitlements | object | {} | App entitlements |
associatedDomains | string[] | [] | Associated domains for universal links |
usesAppleSignIn | boolean | false | Enable Sign in with Apple |
backgroundColor | string | - | Launch screen background color |
icon | string | - | Path to app icon |
Android Configuration
android: {
packageName: "com.example.myapp",
versionCode: 1,
minSdkVersion: 24,
targetSdkVersion: 34,
permissions: [
"INTERNET",
"CAMERA",
],
intentFilters: [ ... ],
}Android Options
| Option | Type | Default | Description |
|---|---|---|---|
packageName | string | Required | Android package name |
versionCode | number | 1 | Version code for Play Store |
minSdkVersion | number | 24 | Minimum Android SDK version |
targetSdkVersion | number | 34 | Target Android SDK version |
compileSdkVersion | number | 34 | Compile SDK version |
permissions | string[] | [] | Android permissions |
intentFilters | object[] | [] | Intent filters for deep links |
backgroundColor | string | - | Splash screen background |
icon | string | - | Path to app icon |
Plugins
Add native capabilities:
plugins: [
// Simple string format
"camera",
"location",
// With configuration
["camera", {
cameraPermission: "Take photos for your profile",
}],
]See Plugins for all available plugins.
Navigation
Configure file-based navigation:
navigation: {
routesDir: "./src/_routes",
generatedDir: "./.teardown",
verbose: false,
}| Option | Type | Default | Description |
|---|---|---|---|
routesDir | string | "./src/_routes" | Route files directory |
generatedDir | string | "./.teardown" | Generated types directory |
verbose | boolean | false | Verbose logging |
Full Example
import { defineConfig } from "@teardown/cli";
export default defineConfig({
name: "My Awesome App",
slug: "myawesomeapp",
version: "1.2.0",
ios: {
bundleIdentifier: "com.mycompany.myawesomeapp",
buildNumber: 12,
deploymentTarget: "15.0",
associatedDomains: [
"applinks:myawesomeapp.com",
"webcredentials:myawesomeapp.com",
],
infoPlist: {
ITSAppUsesNonExemptEncryption: false,
},
},
android: {
packageName: "com.mycompany.myawesomeapp",
versionCode: 12,
minSdkVersion: 24,
targetSdkVersion: 34,
permissions: [
"INTERNET",
"ACCESS_NETWORK_STATE",
],
intentFilters: [{
action: "VIEW",
autoVerify: true,
data: [{
scheme: "https",
host: "myawesomeapp.com",
pathPrefix: "/",
}],
category: ["BROWSABLE", "DEFAULT"],
}],
},
plugins: [
"camera",
["location", {
locationPermission: "Find nearby features",
backgroundLocation: false,
}],
"push-notifications",
"biometrics",
["firebase", {
googleServicesFile: "./GoogleService-Info.plist",
googleServicesJsonFile: "./google-services.json",
}],
],
navigation: {
routesDir: "./src/_routes",
generatedDir: "./.teardown",
},
});Validation
Validate your configuration:
teardown validateShows errors and warnings with suggestions:
Configuration valid!
Summary:
Name: My Awesome App
Slug: myawesomeapp
Version: 1.2.0
iOS: com.mycompany.myawesomeapp (build 12)
Android: com.mycompany.myawesomeapp (version code 12)
Plugins: 5Environment Variables
Reference environment variables in config:
import { defineConfig } from "@teardown/cli";
export default defineConfig({
name: "My App",
slug: "myapp",
version: process.env.APP_VERSION || "1.0.0",
ios: {
bundleIdentifier: process.env.IOS_BUNDLE_ID || "com.example.myapp",
},
});Config File Formats
The CLI looks for config files in this order:
teardown.config.tsteardown.config.jsteardown.config.mjslaunchpad.config.ts(legacy)
Type Safety
The defineConfig helper provides full TypeScript intellisense:
import { defineConfig } from "@teardown/cli";
export default defineConfig({
// Full autocomplete for all options
// Type errors for invalid values
});