{"id":18853086,"url":"https://github.com/featbit/featbit-openfeature-provider-java-server","last_synced_at":"2026-02-04T20:30:14.121Z","repository":{"id":215403957,"uuid":"731077555","full_name":"featbit/featbit-openfeature-provider-java-server","owner":"featbit","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-05T14:38:33.000Z","size":24,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-30T17:49:13.867Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/featbit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-13T10:03:04.000Z","updated_at":"2024-09-12T22:44:14.000Z","dependencies_parsed_at":"2024-01-05T15:53:18.437Z","dependency_job_id":null,"html_url":"https://github.com/featbit/featbit-openfeature-provider-java-server","commit_stats":null,"previous_names":["featbit/featbit-java-server-openfeature-provider","featbit/featbit-openfeature-provider-java-server"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/featbit%2Ffeatbit-openfeature-provider-java-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/featbit%2Ffeatbit-openfeature-provider-java-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/featbit%2Ffeatbit-openfeature-provider-java-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/featbit%2Ffeatbit-openfeature-provider-java-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/featbit","download_url":"https://codeload.github.com/featbit/featbit-openfeature-provider-java-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239793058,"owners_count":19697893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T03:42:53.019Z","updated_at":"2026-02-04T20:30:14.060Z","avatar_url":"https://github.com/featbit.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FeatBit java server OpenFeature provider\n\nThis provider allows to use [FeatBit](https://www.featbit.co/) with the [OpenFeature](https://openfeature.dev/) SDK\nfor Java.\n\nThis provider is designed primarily for use in multi-user systems such as web servers and applications.\nIt is not intended for use in desktop and embedded systems applications.\n\n## Getting started\n\nFeaBit provider works with Java 8 and above and is available on Maven Central.\nYou can add it to your project using the following dependency.\n\n### Installation\n\n```xml\n\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eco.featbit\u003c/groupId\u003e\n        \u003cartifactId\u003efeatbit-openfeature-provider-java-server\u003c/artifactId\u003e\n        \u003cversion\u003e1.0.0\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n### Usage\n\n```java\nFBConfig config = new FBConfig.Builder()\n        .streamingURL(STREAM_URL)\n        .eventURL(EVENT_URL)\n        .build();\n\n// Synchronous\nOpenFeatureAPI.getInstance().setProviderAndWait(new FeatBitProvider(ENV_SECRET, config);\n\n// Asynchronous\nOpenFeatureAPI.getInstance().setProvider(new FeatBitProvider(ENV_SECRET, config);\n\n// Refer to docs to get a client and perform evaluations.\n```\n\nFor more information on using this OpenFeature SDK please refer to\nthe [OpenFeature Java Documentation](https://openfeature.dev/docs/reference/technologies/server/java)\nand [FeatBit Java Server SDK Guide](https://github.com/featbit/featbit-java-sdk).\n\n## OpenFeature Specific Considerations\n\n### Evaluation Context\n\nFeatBit SDK evaluates only a single-user context.\n\nThe OpenFeature specification allows for an optional targeting key, but FeatBit requires a key for evaluation.\nA targeting key must be specified for each context being evaluated. It may be specified using either `targetingKey`, as\nit is in the OpenFeature specification, or `key`/`keyid`, which is the typical identifier for the targeting key.\nIf a `targetingKey` and a `key`/`keyid` are specified, then the targetingKey will take precedence.\n\n`name` is also an attribute that is used to search your user quickly. If you don't set it explicitly in your context,\nFeatBit will use the targeting key as the name.\n\nFeatbit SDK only supports string type values for custom attributes in evaluation context.\n\n```java\n EvaluationContext ctx = new ImmutableContext(\"user-key\", new HashMap() {{\n    put(\"name\", new Value(\"user-name\"));\n    put(\"country\", new Value(\"USA\"));\n}});\n\n```\n\n### Evaluation\n\nThe OpenFeature specification allows for an optional evaluation context in the evaluation request, but FeatBit requires\na context for evaluation.\n\n```java\nClient client = OpenFeatureAPI.getInstance().getClient();\n// Evaluation Context\nEvaluationContext evalCtx = new ImmutableContext(\"user-key\", new HashMap() {{\n    put(\"name\", new Value(\"user-name\"));\n    put(\"country\", new Value(\"USA\"));\n}});\n// Evaluate a feature flag\nString result = client.getStringValue(flagKey, defaultValue, evalCtx);\n// Evaluate a feature detail\nFlagEvaluationDetails\u003cString\u003e details = client.getStringDetails(flagKey, defaultValue, evalCtx);\n\n```\n\nWhen you use the `Client#getObjectValue` or `Client#getObjectDetails` methods, the SDK will attempt to convert the\nresult to the specified type:\n\n1. the SDK will convert the result to the `Value` type according to the default `Value`.\n2. If your put a `List` or `Structure` Value as the default value, the SDK will parse the result as it is a json object.\n\nIf you set a wrong type of default value which is not corresponding to the settings in FeatBit flag center, the SDK may\nthrow an exception.\n\n## More Information\n\nRead documentation for in-depth instructions on configuring and using FeatBit. You can also head straight to the\ncomplete [reference guide](https://docs.featbit.co/)\n\nRead documentation for in-depth instructions on using OpenFeature. You can also head straight to\nthe [Documentation](https://openfeature.dev/docs/reference/intro) ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeatbit%2Ffeatbit-openfeature-provider-java-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeatbit%2Ffeatbit-openfeature-provider-java-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeatbit%2Ffeatbit-openfeature-provider-java-server/lists"}