Plugins
Extend your app with native capabilities.
Plugins add native capabilities to your app without manual native code changes. Configure plugins in teardown.config.ts and they're applied during prebuild.
Using Plugins
List Available Plugins
teardown plugins listGet Plugin Info
teardown plugins info cameraShows:
- Plugin name and description
- Supported platforms
- Configuration options
- Usage examples
Configuration
Add plugins to your teardown.config.ts:
import { defineConfig } from "@teardown/cli";
export default defineConfig({
// ...
plugins: [
// Simple string format
"camera",
"location",
// With configuration
["camera", {
cameraPermission: "We need camera access to scan documents",
}],
["location", {
locationPermission: "We need your location for navigation",
backgroundLocation: true,
}],
],
});Available Plugins
Camera
Camera access for photos and videos.
plugins: [
["camera", {
cameraPermission: "Take photos for your profile",
microphonePermission: "Record video with audio",
}],
]| Option | Type | Description |
|---|---|---|
cameraPermission | string | iOS camera permission message |
microphonePermission | string | iOS microphone permission message |
Location
Location services and GPS access.
plugins: [
["location", {
locationPermission: "Find nearby restaurants",
backgroundLocation: false,
}],
]| Option | Type | Description |
|---|---|---|
locationPermission | string | Permission message |
backgroundLocation | boolean | Enable background location |
Push Notifications
Push notification support.
plugins: [
["push-notifications", {
enableBadge: true,
enableSound: true,
}],
]| Option | Type | Description |
|---|---|---|
enableBadge | boolean | Show badge on app icon |
enableSound | boolean | Play notification sounds |
Biometrics
Face ID / Touch ID authentication.
plugins: [
["biometrics", {
faceIDPermission: "Authenticate securely with Face ID",
}],
]| Option | Type | Description |
|---|---|---|
faceIDPermission | string | iOS Face ID permission message |
Deep Linking
URL scheme and universal link handling.
plugins: [
["deep-linking", {
scheme: "myapp",
associatedDomains: ["applinks:myapp.com"],
}],
]| Option | Type | Description |
|---|---|---|
scheme | string | Custom URL scheme |
associatedDomains | string[] | iOS associated domains |
Firebase
Firebase SDK integration.
plugins: [
["firebase", {
googleServicesFile: "./GoogleService-Info.plist",
googleServicesJsonFile: "./google-services.json",
}],
]| Option | Type | Description |
|---|---|---|
googleServicesFile | string | Path to iOS config file |
googleServicesJsonFile | string | Path to Android config file |
Contacts
Access to device contacts.
plugins: [
["contacts", {
contactsPermission: "Invite friends to the app",
}],
]Calendar
Calendar access.
plugins: [
["calendar", {
calendarPermission: "Schedule events in your calendar",
}],
]Photo Library
Photo library access.
plugins: [
["photo-library", {
photoLibraryPermission: "Select photos to upload",
savePhotosPermission: "Save photos to your library",
}],
]Bluetooth
Bluetooth connectivity.
plugins: [
["bluetooth", {
bluetoothPermission: "Connect to Bluetooth devices",
}],
]Sign in with Apple
Apple authentication.
plugins: [
"sign-in-with-apple",
]No configuration options required.
Plugin Processing
During teardown prebuild, plugins:
- Add dependencies - Native libraries are added to Podfile/build.gradle
- Configure permissions - Permission strings added to Info.plist/AndroidManifest
- Modify native files - Necessary code changes applied
- Generate code - Any required boilerplate generated
Plugin Order
Plugins are processed in order. Some plugins may depend on others:
plugins: [
// Firebase should come before push notifications if using FCM
"firebase",
"push-notifications",
// Independent plugins can be in any order
"camera",
"location",
]Troubleshooting
Unknown Plugin
Unknown plugin: xyzCheck available plugins:
teardown plugins listPlugin Conflicts
If two plugins conflict:
- Check plugin documentation for compatibility
- Try reordering plugins
- Run
teardown prebuild --cleanto start fresh
Permissions Not Working
After adding a permission plugin:
teardown prebuild --clean
teardown run iosiOS may cache permissions - delete the app and reinstall.
Related
- Configuration - Full config reference
- prebuild - Generate native projects