Flip Bridge
The Flip Bridge handles communication between your embeddable apps and the Flip
App or Flip Admin Console.
Contents
Installation
npm install --save @getflip/bridge
yarn add @getflip/bridge
Usage
The library exposes a set of functions and listeners you can use to communicate
with the Flip App and Flip Admin Console (host app for short).
Internationalization
getAvailableLangs
Get all available languages of the host app.
Returns string[]
Example
import { getAvailableLangs } from "@getflip/bridge";
const availableLanguages = await getAvailableLangs();
getLang
Get the current language of the host app.
Returns string
Example
import { getLang } from "@getflip/bridge";
const currentLanguage = await getLang();
Navigation
navigate
Navigate to a specific route.
Returns boolean
Example
import { navigate } from "@getflip/bridge";
await navigate("/my-app/settings");
Theming
getTheme
Get the current theme.
Returns 'light' | 'dark'
Example
import { getTheme } from "@getflip/bridge";
const currentTheme = await getTheme();
Development
Start the compiler in watch mode for local development:
yarn
yarn dev
Production builds and releases are managed via our Github workflows. Make sure
to create a Changeset using yarn changeset
if you want to trigger a new
release.