Class Bifrost

Set of methods available for eitri-apps

Hierarchy

  • Bifrost

Properties

http: Http

Set of methods for handling HTTP requests

In an eitri-app, it's important to note that it's only possible to make HTTP requests through these commands. The format is similar to a well-known library called axios.

navigation: Navigation

Set of methods for navigating between screens. Each set of files (jsx and js) in the view folder generates a screen. It's possible to navigate through these screens using the methods described here.

nativeNavigation: NativeNavigation

Interaction with the native navigation of the device.

Restricted usage: Only available with app owner authorization.

This type of navigation can cause increased memory consumption but can handle complex scenarios where the state of the current eitri-app needs to be preserved in memory while another eitri-app is running in the foreground.

storage: Storage

Set of methods for operating data storage in eitri-apps

Notes:

Storage data is not shared between different eitri-apps. Data is transported as a string and transformed with parsing. Pay attention to the size of the data passed to avoid affecting the experience.

sharedStorage: SharedStorage

Set of methods to operate data storage shared between eitri-apps.

To use SharedStorage and make data available between two or more Eitri-Apps, an AppGroup is required.

AppGroups are a concept that permits some resources to be shared, such as storage. When two or more Eitri-Apps are in the same AppGroup, they can write data in one Eitri-App and retrieve it in another Eitri-App.

To set up an AppGroup configuration, please contact Eitri support.

deeplink: Deeplink

Methods for deep link opening

clipboard: Clipboard

Methods for clipboard access

Methods for filesystem access, download and upload management

camera: Camera

Methods for interacting with camera on devices

Methods for shared filesystem access, download and upload management

keyboard: Keyboard

Methods for keyboard access and manipulation

version: string

Current eitri-bifrost version

tracking: Tracking

Set of tools for tracking eitri-apps

Available tools:

  • Clarity
  • Google Analytics
  • Datadog
eventBus: EventBus

Tools for listening to events on your eitri-app coming from the main app.

You can also use this bus to implement a pub/sub pattern inside your app.

share: Share

Methods for sharing content using the device's share sheet.

biometrics: Biometrics

Methods for using biometric authentication.

notification: Notification

Methods for managing device notifications.

environment: Environment

Methods with infos related to the current environment

system: System

Methods for accessing the system's information.

haptic: Haptic

Methods for interacting with haptic feedback on devices

geolocation: Geolocation

Methods for managing device geolocation.

bottomBar: BottomBar

Methods for interacting with bottom navigation bar

mediaNotification: MediaNotification

Methods for managing mediaNotification.

webFlow: WebFlow

Web interface that allows users to navigate through a complex web flow.

It can be used for corporate logins and other complex web flows involving multiple redirects in an OAuth flow.

appStore: AppStore

Methods for allowing the app to perform actions related to the device's application store

screen: Screen

Methods for interacting with the device's screen

device: Device

Methods for accessing device informations

Accessors

  • get exposedApis(): any
  • Returns the exposed APIs of the app, granting privileged access that is not commonly available to eitri-apps.

    Eitri-apps operate within a sandboxed environment, and this function allows the host (app) to provide features and functionality that extend eitri-apps base capabilities.

    Example:

    const result = await Eitri.exposedApis.math.sum({a: 1, b: 2});
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Returns any

Methods

  • Fetches configurations specific to the current eitri-app.

    Example:

    const appConfig = await Eitri.getConfigs()
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Returns Promise<AppConfigs>

  • Modern and introspectable alternative to exposedApis.

    This method returns a structured object that allows you to access privileged native features exposed by the host app.

    Unlike exposedApis, which uses dynamic proxies and resolves methods at runtime, modules() enables real introspection.

    This makes it safer and more flexible when:

    • APIs may vary across devices or host app versions.
    • You want to conditionally render UI or control logic based on available capabilities.

    It grants access to native features that are not typically available to eitri-apps.

    Since eitri-apps operate in a sandboxed environment, this method allows the host app to expose features and extend the default capabilities available to eitri-apps.

    Example:

    if(!Eitri.canIUse(28)){
    // use exposedApis for older API_LEVEL
    return
    }

    const modules = await Eitri.modules();
    const sumMethod = modules.math?.sum;

    // Detect if `sum` is available and conditionally enable UI
    if (sumMethod) {
    enableSumButton();
    }

    // [...]

    // Use the `sum` method provided by the host app
    const result = await sumMethod({ a: 1, b: 2 });
    console.assert(result === 3);

    Compatibility Control

    • API LEVEL 28Functionality added

    Returns Promise<any>

  • Returns the data received during the initialization of the eitri-app.

    Example:

    const startParams = await Eitri.getInitializationInfos()
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Returns Promise<Object>

  • Opens an HTTPS address in the system's default browser.

    Example:

    await Eitri.openBrowser({url: "https://calindra.tech"});
    

    Compatibility Control

    • API LEVEL 1 - Functionality added
    • API LEVEL 11 - Parameter inApp

    Parameters

    Returns Promise<void>

  • Checks if the desired API level is compatible with the API_LEVEL used in the eitri-machine

    Check compatibility control concept

    • API LEVEL 1 - Functionality added

    Parameters

    • apiLevelCandidate: number

      apiLevel to validate

    Returns boolean

  • Closes the current eitri-app.

    Example:

    Eitri.close()
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Returns Promise<void>

  • Checks if the device is online.

    Example:

    const isOnline = await Eitri.isOnline();
    

    Compatibility Control

    • API LEVEL 9 - Functionality added

    Returns Promise<boolean>

Generated using TypeDoc