Skip to content

Commit 54d02a4

Browse files
committed
Installation instructions.
1 parent b0da790 commit 54d02a4

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

README.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,40 @@ class MyClass {
2626
```
2727

2828
## Requirements
29-
- Java 11
29+
- Java 11+
3030

3131
## Installation
32-
TODO
32+
33+
### Add it to your build
34+
35+
Maven:
36+
```xml
37+
<dependency>
38+
<groupId>dev.openfeature</groupId>
39+
<artifactId>javasdk</artifactId>
40+
<version>0.0.1-SNAPSHOT</version>
41+
</dependency>
42+
```
43+
44+
Gradle:
45+
```groovy
46+
dependencies {
47+
implementation 'dev.openfeature:javasdk:0.0.1-SNAPSHOT'
48+
}
49+
```
50+
51+
### Configure it
52+
To configure it, you'll need to add a provider to the global singleton `OpenFeatureAPI`. From there, you can generate a `Client` which is usable by your code. While you'll likely want a provider for your specific backend, we've provided a `NoOpProvider`, which simply returns the default passed in.
53+
```java
54+
class MyApp {
55+
public void example(){
56+
OpenFeatureAPI api = OpenFeatureAPI.getInstance();
57+
api.setProvider(new NoOpProvider());
58+
Client client = api.getClient();
59+
// Now use your `client` instance to evaluate some feature flags!
60+
}
61+
}
62+
```
3363
## Contacting us
3464
We hold regular meetings which you can see [here](https://github.com/open-feature/community/#meetings-and-events).
3565

0 commit comments

Comments
 (0)