Skip to content

Remove ldclient.Config from provider constructor #32

@jlc-christie

Description

@jlc-christie

Is your feature request related to a problem? Please describe.
When initialising the LaunchDarklyProvider it currently requires passing the Config type declared in a third party package (ldclient), which means that in order to not cause type checking issues you have to either:

  • directly depend on the ldclient package solely to init the provider
  • rely on the transitive dependency and assume this package will never remove the dependency
  • provide an object that is structurally equivalent to Config and instruct the type checker to ignore the error

Describe the solution you'd like
Re-exporting the Config type like FastAPI does with many starlette types, e.g. status so consumers can use the transitively dependent type.

Describe alternatives you've considered

  • Define an internal type within this package, e.g.:
    • A new local Config type that only contains a subset of upstream properties that are solely required for this provider to work.
    • A new local config constructor param could just be of type dict[str, Any] that is deconstructed directly to ldclient.Config internally.
    • Constructor could just take required args as well as **kwargs and then everything else is proxied to ldclient.Config internally using the kwargs.

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions