Skip to content

Typings for Remote Config defaults (defaultConfig) are missing JSON values #6106

Open
@ceisele-r

Description

@ceisele-r

[REQUIRED] Describe your environment

  • Operating System version: Windows 11
  • Browser version: Chrome 100
  • Firebase SDK version: 8 / 9
  • Firebase Product: remote config

[REQUIRED] Describe the problem

Via Firebase Console, we can set a JSON value for a remote config entry.

But in a (typescript) application, there is no way to set a default JSON value as the typings for defaultConfig only allow a default config value to be either string, number or boolean.

The issue seems to be in these two places:

Steps to reproduce:

Try to set the remote config default value to a JSON value via

remoteConfig.defaultConfig = {
      "myfeatureflag": {
          foo: "bar"
       },
    }

This creates the following Typescript error:

Type '{ [x: string]: { foo: string; }; }' is not assignable to type '{ [key: string]: string | number | boolean; }'.
  'string' index signatures are incompatible.
    Type '{ foo: string; }' is not assignable to type 'string | number | boolean'.ts(2322)

Relevant Code:

See above

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions