Files
flipper/flipper-js-client-sdk
Michel Weststrate b0310f4528 Bump deps of flipper-js-client-sdk
Summary: Bump several deps of flipper-js-client-sdk at once, to close multiple dependabot PRs

Reviewed By: passy

Differential Revision: D30931608

fbshipit-source-id: 4c95a98e4fce805c8c92c605b3fd7eb71e7daaa7
2021-09-14 06:11:41 -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
2021-09-14 06:11:41 -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'})