Move GK documentation / explanation to the refguide
Summary: ^ Reviewed By: nikoant Differential Revision: D25559029 fbshipit-source-id: cf47c3f3b9d567ba24b7a6a254a945c763350195
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f9c8826090
commit
63e46738c1
@@ -2,6 +2,7 @@
|
|||||||
id: flipper-plugin
|
id: flipper-plugin
|
||||||
title: Desktop Plugin API
|
title: Desktop Plugin API
|
||||||
---
|
---
|
||||||
|
import {FbInternalOnly} from 'internaldocs-fb-helpers';
|
||||||
|
|
||||||
## PluginClient
|
## 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.
|
Returns `true` if the current user is part of the given GK. `false` in all other cases.
|
||||||
|
|
||||||
|
<FbInternalOnly>
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
</FbInternalOnly>
|
||||||
|
|
||||||
## DevicePluginClient
|
## DevicePluginClient
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|||||||
@@ -121,7 +121,6 @@ module.exports = {
|
|||||||
'Plugin Development': [
|
'Plugin Development': [
|
||||||
'fb/developmentworkflow',
|
'fb/developmentworkflow',
|
||||||
'fb/TypeScript',
|
'fb/TypeScript',
|
||||||
'fb/using-gatekeepers',
|
|
||||||
'fb/adding-npm-dependencies-0',
|
'fb/adding-npm-dependencies-0',
|
||||||
'fb/adding-analytics-0',
|
'fb/adding-analytics-0',
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user