Skip to main content

JavaScript API

The airborne-react-native package exposes a small set of JavaScript functions for reading what the native SDK downloaded — the release config, the bundle path, and the contents of individual files inside the downloaded package. Each function takes the namespace (the application/namespace identifier you configured in the native integration) and returns a Promise.

This API is identical across the plain React Native and Expo tracks.

Not available in Expo Go

These functions are backed by a native module. They throw a linking error if the native module is not present — for example in Expo Go, or if you have not rebuilt the app after installing the package.

readReleaseConfig

Reads the release configuration that the native SDK downloaded for the given namespace.

function readReleaseConfig(nameSpace: string): Promise<string>
ParameterTypeDescription
nameSpacestringThe application/namespace identifier whose release config to read.

Returns: Promise<string> — the release config as a JSON string. Reject if the config cannot be read.

import { readReleaseConfig } from 'airborne-react-native';

const handleReadReleaseConfig = async () => {
try {
const config = await readReleaseConfig('airborne-example');
console.log(config);
} catch (error) {
console.error(error);
}
};

getBundlePath

Returns the path to the downloaded JS bundle for the given namespace.

function getBundlePath(nameSpace: string): Promise<string>
ParameterTypeDescription
nameSpacestringThe application/namespace identifier whose bundle path to return.

Returns: Promise<string> — the file path to the bundle. When no downloaded bundle is available, the native layer falls back to the bundled asset path.

import { getBundlePath } from 'airborne-react-native';

const handleGetBundlePath = async () => {
try {
const path = await getBundlePath('airborne-example');
console.log(path);
} catch (error) {
console.error(error);
}
};

getFileContent

Reads the content of a file from the downloaded bundle for the given namespace.

function getFileContent(nameSpace: string, filePath: string): Promise<string>
ParameterTypeDescription
nameSpacestringThe application/namespace identifier the file belongs to.
filePathstringThe relative path of the file within the downloaded package.

Returns: Promise<string> — the file content as a string. Reject if the file cannot be read or does not exist.

import { getFileContent } from 'airborne-react-native';

const handleGetFileContent = async () => {
try {
const content = await getFileContent('airborne-example', 'test.js');
console.log(content);
} catch (error) {
console.error(error);
}
};

Default export

The package's default export is the underlying native module. Prefer the named functions above; they are thin wrappers over Airborne.readReleaseConfig, Airborne.getFileContent, and Airborne.getBundlePath.

import Airborne from 'airborne-react-native';

See also