Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions docs/further_reading.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,40 @@

Covers advanced topics (different config options and scenarios)

## Configuration Options
The following configuration options are available to control the behaviour of the SDK.
You can provide options by passing them in when the client is created e.g.

```golang
// Create Options
client, err := harness.NewCfClient(myApiKey,
harness.WithURL("https://config.ff.harness.io/api/1.0"),
harness.WithEventsURL("https://events.ff.harness.io/api/1.0"),
harness.WithPullInterval(1),
harness.WithStreamEnabled(false))

```

| Name | Config Option | Description | default |
|-----------------|----------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|
| baseUrl | harness.WithURL("https://config.ff.harness.io/api/1.0") | the URL used to fetch feature flag evaluations. You should change this when using the Feature Flag proxy to http://localhost:7000 | https://config.ff.harness.io/api/1.0 |
| eventsUrl | harness.WithEventsURL("https://events.ff.harness.io/api/1.0"), | the URL used to post metrics data to the feature flag service. You should change this when using the Feature Flag proxy to http://localhost:7000 | https://events.ff.harness.io/api/1.0 |
| pollInterval | harness.WithPullInterval(1)) | when running in stream mode, the interval in minutes that we poll for changes. | 60 |
| enableStream | harness.WithStreamEnabled(false), | Enable streaming mode. | true |
| enableAnalytics | *Not Supported* | Enable analytics. Metrics data is posted every 60s | *Not Supported* |

## Logging Configuration
You can provide your own logger to the SDK, passing it in as a config option.
The following example creates an instance of the logrus logger and provides it as an option.


```golang
logger := logrus.New()

// Create a feature flag client
client, err := harness.NewCfClient(myApiKey, harness.WithLogger(logger))
```

## Recommended reading

[Feature Flag Concepts](https://ngdocs.harness.io/article/7n9433hkc0-cf-feature-flag-overview)
Expand Down