Files
flipper/flipper-js-client-sdk
Pascal Hartig 25305d696b Upgrade deps for flipper-js-client-sdk
Summary:
Combining a bunch of dependabot requests.

allow-large-files

Reviewed By: mweststrate

Differential Revision: D30667240

fbshipit-source-id: 9ada41eb0a172b9870906076acc9ce934d6d3c3f
2021-08-31 10:32:02 -07:00
..
2020-11-09 08:24:28 -08:00
2020-06-11 08:45:35 -07:00
2020-06-11 08:45:35 -07:00

flipper-sdk-api

SDK to build Flipper clients for JS based apps

Installation

yarn add flipper-client-sdk

Usage

Example

class SeaMammalPlugin extends AbsctractFlipperPlugin {
  getId(): string {
    return 'sea-mammals';
  }

  runInBackground(): boolean {
    return true;
  }

  newRow(row: {id: string, url: string, title: string}) {
    this.connection?.send("newRow", row)
  }
}

const flipperClient = newWebviewClient();
cosnt plugin = new SeaMammalPlugin();
flipperClient.addPlugin();
flipperClient.start('Example JS App');
plugin.newRow({id: '1', title: 'Dolphin', url: 'example.com'})