Files
flipper/flipper-js-client-sdk
Michel Weststrate 8b111e48e6 Bump dependencies in flipper-js-client-sdk
Summary: Dependabot bumping deps one by one create a shitload of PRs, so creating a bunch of diffs that bumps all deps per subproject, using `yarn upgrade-interactive`

Reviewed By: passy

Differential Revision: D24137398

fbshipit-source-id: 2a653a5a92742f8a063e529007949c26899f35e5
2020-10-08 01:39:16 -07: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'})