getKeyContext method

Future<KeyContextResponse> getKeyContext()

Calls GET /api/v1/keys/me to discover the project + environment this API key is scoped to. Result is cached for the lifetime of this client.

Note: only meaningful in API key mode. In JWT mode, use BELLA_BAXTER_PROJECT / BELLA_BAXTER_ENV env vars instead.

Implementation

Future<KeyContextResponse> getKeyContext() async {
  if (_keyContext != null) return _keyContext!;
  final resp = await _api
      .getBellaBaxterFeaturesApiKeysGetKeyContextApi()
      .getKeyContext();
  _keyContext = resp.data!;
  return _keyContext!;
}