Imported Packages allow you to add third-party libraries to your app.

📘

React Native & Expo

Imported libraries must be compatible with React Native and the Expo managed workflow

📘

Cocoapods

Packages which require running pod install for iOS installation are not currently supported. Look for packages without this requirement

📘

Linking

Packages which require linking are not currently supported. Look for packages which have auto-linking

Finding compatible packages

You can find several compatible libraries here. Make sure they also meet the above requirements.

If you want to import libraries from the npm registry, please follow Expo's tips for determining compatibility.

Adding a package

First, navigate to the Packages tab in the Custom Code modal.

Click the "+" icon to add a new package.

Then, enter your Package Name in the first input field and it's Version in the second input field.

📘

In most cases, you will want the latest version of your package.

If you want a specific version, be sure to specify in the version input, with or without npm ~, ^, or >= syntax.

1122

To remove a package, click the '-' button at the end of the row where the package is listed.

Expo SDK Packages

The following are common packages in the Expo SDK that are not yet part of the Draftbit platform. We've made these available by default for use in Custom Functions.

Examples for how to add these to your Draftbit app in custom code are here.

Package NameDescription
expo-assetPackage that provides an interface to access Expo's asset system.
expo-avPackage that provides Audio.Sound objects and Video components for managing audio and video playback.
expo-clipboardProvides an interface for getting and setting Clipboard content on Android, and iOS.
expo-constantsProvides system information that remains constant throughout the lifetime of an app's install.
expo-cameraProvides a component to use the device's camera to take photos or record video.

*Must require CAMERA permissions for the camera and AUDIO_RECORDING permissions to record video.
expo-barcode-scannerProvides a component to use the device's camera as a barcode scanner.

*Must require CAMERA permissions
expo-permissionsPackage that handles asking the user for various device permissions.
expo-image-pickerPackage that provides access to the system's UI for selecting images and videos from the phone's library or taking a photo with the camera.

*Must require CAMERA permissions for the camera and MEDIA_LIBRARY permissions to access and select from phone's library.
expo-sensorsProvides various APIs for accessing device sensors to measure motion, orientation, pressure, magnetic fields, and step count.
expo-sharingPackage that allows sharing files directly with other compatible applications.
expo-smsPackage that provides access to the system's UI/app for sending SMS messages.
Async StorageProvides an asynchronous, unencrypted, persistent, key-value storage solution
RN AlertLaunches an alert dialog with the specified title and message.
RN AppearancePackage that exposes information about the user's appearance preferences, such as their preferred color scheme (light or dark).
RN DimensionsPackage that updates width and height values when screen size changes.
RN KeyboardPackage that provides methods to control keyboard events.
RN PlatformPackage that provides a module to detect the platform (iOS or Android) in which the app is running. Platform specific tasks are handled using it.
RN VibrationPackage that contains the method to trigger a vibration with a fixed duration. The duration here is specified in milliseconds.

Recommended Package Versions

Some packages have specific versions which should be used. Below you'll find a list of some of those packages and the recommended version to use.

PackageVersion
@react-native-async-storage/async-storage~1.17.3
@segment/analytics-react-native^2.7.1
@segment/sovran-react-native^0.4.4
@shopify/flash-list1.1.0
@shopify/mime-types2.0.0
@stripe/stripe-react-native0.13.1
expo-analytics-amplitude~11.3.0
expo-apple-authentication~4.3.0
expo-auth-session~3.7.1
expo-barcode-scanner~11.4.0
expo-battery~6.3.0
expo-crypto~11.0.0
expo-error-recovery~3.2.0
expo-file-system~14.1.0
expo-linking~3.2.2
expo-local-authentication~12.3.0
expo-location~14.3.0
expo-sharing~10.3.0
expo-sqlite~10.3.0
expo-task-manager~10.3.0
lottie-react-native5.1.3
react-native-purchases^5.0.1
sentry-expo~5.0.0
stream-chat-expo^5.1.0
victory-native^36.6.7

What’s Next

Learn about using imported packages in your app