diff --git a/docs/extending/flipper-plugin.mdx b/docs/extending/flipper-plugin.mdx index cac3f817a..415024141 100644 --- a/docs/extending/flipper-plugin.mdx +++ b/docs/extending/flipper-plugin.mdx @@ -2,6 +2,7 @@ id: flipper-plugin title: Desktop Plugin API --- +import {FbInternalOnly} from 'internaldocs-fb-helpers'; ## PluginClient @@ -238,6 +239,18 @@ Usage: `client.GK(gatekeeper: string): boolean` Returns `true` if the current user is part of the given GK. `false` in all other cases. + + +To use a gatekeeper in the Facebook build of Flipper: + +1. [Create the gatekeeper](https://www.internalfb.com/intern/gatekeeper/) +2. Add the Gatekeepers name to the `subscribedGatekeepers` array in `fbsource/xplat/sonar/desktop/src/fb/GK.tsx` +3. Use `client.GK('name_of_gk')` to read the gatekeeper, or alternatively: `import {GK} from 'flipper'; GK.get('name_of_gk')` + +The gatekeepers are cached in `localStorage`. Therefore, you might get the cached result of the gatekeeper on the first access (which defaults to `false`). On the next start of the app you will get the new result. + + + ## DevicePluginClient ### Properties diff --git a/website/sidebars.js b/website/sidebars.js index cd2c15547..6a3deef9f 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -121,7 +121,6 @@ module.exports = { 'Plugin Development': [ 'fb/developmentworkflow', 'fb/TypeScript', - 'fb/using-gatekeepers', 'fb/adding-npm-dependencies-0', 'fb/adding-analytics-0', {