Skip to content

Commit e024124

Browse files
committed
readme updates
1 parent 0180903 commit e024124

File tree

1 file changed

+60
-9
lines changed

1 file changed

+60
-9
lines changed

README.md

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ This SDK is compatible with [Featurevisor](https://featurevisor.com/) v2.0 proje
77
## Table of contents <!-- omit in toc -->
88

99
- [Installation](#installation)
10+
- [Repository](#repository)
11+
- [Dependency](#dependency)
12+
- [Authentication](#authentication)
1013
- [Initialization](#initialization)
1114
- [Evaluation types](#evaluation-types)
1215
- [Context](#context)
@@ -51,22 +54,68 @@ This SDK is compatible with [Featurevisor](https://featurevisor.com/) v2.0 proje
5154

5255
## Installation
5356

54-
In your Java application, add the dependency to your `pom.xml`:
57+
In your Java application, update `pom.xml` to add the following:
58+
59+
### Repository
60+
61+
For finding GitHub Package:
62+
63+
```xml
64+
<repositories>
65+
<repository>
66+
<id>github</id>
67+
<url>https://maven.pkg.github.com/featurevisor/featurevisor-java</url>
68+
</repository>
69+
</repositories>
70+
```
71+
72+
### Dependency
73+
74+
Add Featurevisor Java SDK as a dependency with your desired version:
75+
76+
```xml
77+
<dependencies>
78+
<dependency>
79+
<groupId>com.featurevisor</groupId>
80+
<artifactId>featurevisor-java</artifactId>
81+
<version>0.0.3</version>
82+
</dependency>
83+
</dependencies>
84+
```
85+
86+
Find latest version here: [https://github.com/featurevisor/featurevisor-java/packages](https://github.com/featurevisor/featurevisor-java/packages)
87+
88+
### Authentication
89+
90+
To authenticate with GitHub Packages, in your `~/.m2/settings.xml` file, add the following:
5591

5692
```xml
57-
<dependency>
58-
<groupId>com.featurevisor</groupId>
59-
<artifactId>featurevisor-java</artifactId>
60-
<version>1.0.0</version>
61-
</dependency>
93+
<?xml version="1.0" encoding="UTF-8"?>
94+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
95+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
96+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
97+
http://maven.apache.org/xsd/settings-1.0.0.xsd">
98+
99+
<servers>
100+
<server>
101+
<id>github</id>
102+
<username>YOUR_GITHUB_USERNAME</username>
103+
<password>YOUR_GITHUB_TOKEN</password>
104+
</server>
105+
</servers>
106+
107+
</settings>
62108
```
63109

110+
You can generate a new GitHub token with `read:packages` scope here: [https://github.com/settings/tokens](https://github.com/settings/tokens)
111+
112+
See example application here: [https://github.com/featurevisor/featurevisor-java-example](https://github.com/featurevisor/featurevisor-java-example)
113+
64114
## Initialization
65115

66116
The SDK can be initialized by passing [datafile](https://featurevisor.com/docs/building-datafiles/) content directly:
67117

68118
```java
69-
import com.featurevisor.sdk.Featurevisor;
70119
import com.featurevisor.sdk.Instance;
71120
import com.featurevisor.types.DatafileContent;
72121

@@ -78,8 +127,10 @@ String datafileContent = // ... load your datafile content
78127
DatafileContent datafile = DatafileContent.fromJson(datafileContent);
79128

80129
// Create SDK instance
81-
Instance f = Featurevisor.createInstance(new Instance.InstanceOptions()
82-
.datafile(datafile));
130+
Instance instance = new Instance(
131+
new Instance.InstanceOptions()
132+
.datafile(datafileContent)
133+
);
83134
```
84135

85136
## Evaluation types

0 commit comments

Comments
 (0)