Teardown

Adapters

Platform adapters for storage, device info, and notifications.

The Teardown SDK uses adapters to abstract platform-specific functionality. This allows the SDK to work across different React Native environments (Expo, bare RN) and with different underlying libraries.

Adapter Types

Device Adapters

Collect device and application information for identification and analytics.

AdapterPackageUse Case
ExpoDeviceAdapterexpo-device, expo-applicationExpo projects
DeviceInfoAdapterreact-native-device-infoBare RN projects
BasicAdapterNoneFallback/testing

View Device Adapters →

Storage Adapters

Handle persistent data storage for sessions, device IDs, and version status.

AdapterPackageUse Case
MMKVStorageAdapterreact-native-mmkvFast sync storage (recommended)
AsyncStorageAdapter@react-native-async-storage/async-storageBroader compatibility

View Storage Adapters →

Notification Adapters

Handle push notification registration and token management.

AdapterPackageUse Case
ExpoNotificationsAdapterexpo-notificationsExpo projects
FirebaseMessagingAdapter@react-native-firebase/messagingFirebase Cloud Messaging
WixNotificationsAdapterreact-native-notificationsWix notifications library

View Notification Adapters →

Required Adapters

When initializing TeardownCore, you must provide:

const teardown = new TeardownCore({
  org_id: 'your-org-id',
  project_id: 'your-project-id',
  api_key: 'your-api-key',
  storageAdapter: new MMKVStorageAdapter(),    // Required
  deviceAdapter: new ExpoDeviceAdapter(),       // Required
});

Common Configurations

Expo Project

import { TeardownCore } from '@teardown/force-updates';
import { ExpoDeviceAdapter } from '@teardown/force-updates/adapters/expo';
import { MMKVStorageAdapter } from '@teardown/force-updates/adapters/mmkv';

export const teardown = new TeardownCore({
  org_id: 'your-org-id',
  project_id: 'your-project-id',
  api_key: 'your-api-key',
  storageAdapter: new MMKVStorageAdapter(),
  deviceAdapter: new ExpoDeviceAdapter(),
});

Bare React Native Project

import { TeardownCore } from '@teardown/force-updates';
import { DeviceInfoAdapter } from '@teardown/force-updates/adapters/device-info';
import { AsyncStorageAdapter } from '@teardown/force-updates/adapters/async-storage';

export const teardown = new TeardownCore({
  org_id: 'your-org-id',
  project_id: 'your-project-id',
  api_key: 'your-api-key',
  storageAdapter: new AsyncStorageAdapter(),
  deviceAdapter: new DeviceInfoAdapter(),
});

Custom Adapters

All adapter types can be extended for custom implementations. See individual adapter sections for interface definitions.