MCPcopy Create free account
hub / github.com/desktop/desktop / fetchFeatureFlags

Method fetchFeatureFlags

app/src/lib/api.ts:2098–2109  ·  view source on GitHub ↗

* Fetches the Desktop-specific features that are enabled for the user. * * @returns An array of strings with the feature flags enabled for the user.

()

Source from the content-addressed store, hash-verified

2096 * @returns An array of strings with the feature flags enabled for the user.
2097 */
2098 public async fetchFeatureFlags(): Promise<ReadonlyArray<string> | undefined> {
2099 try {
2100 const response = await this.ghRequest('GET', '/desktop_internal/features')
2101 const featuresResponse = await parsedResponse<IUserFeaturesResponse>(
2102 response
2103 )
2104 return featuresResponse.features
2105 } catch (e) {
2106 log.warn(`fetchFeatureFlags: failed with endpoint ${this.endpoint}`, e)
2107 return undefined
2108 }
2109 }
2110
2111 /**
2112 * Fetches the Copilot info related to the user (license and API endpoint).

Callers 1

fetchUserFunction · 0.95

Calls 2

ghRequestMethod · 0.95
warnMethod · 0.80

Tested by

no test coverage detected