Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
This repository houses the .Net based C# SDK for Optimizely Full Stack.
Branch: master
Clone or download
juancarlostong chore(update version) (#136)
* update CHANGELOG.md
* update versioning on various files
Latest commit 17a0271 Mar 1, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
OptimizelySDK.DemoApp
OptimizelySDK.Net35
OptimizelySDK.Net40 chore(update version) (#136) Mar 1, 2019
OptimizelySDK.NetStandard16 feat(eventdispatcher): HttpClientEventDispatcher45 now logs full exce… Feb 15, 2019
OptimizelySDK.Package
OptimizelySDK.Tests
OptimizelySDK
.gitattributes
.gitignore Kroach/oasis 1439 sign (#30) Nov 6, 2017
.travis.yml
CHANGELOG.md chore(update version) (#136) Mar 1, 2019
CONTRIBUTING.md chore(contrib): Add PR template and commit message guidelines. (#111) Nov 9, 2018
LICENSE Add missing license file at root. Apr 14, 2017
OptimizelySDK.Travis.sln ci(codesign): upload build artifacts to s3 (#127) Feb 15, 2019
OptimizelySDK.png
OptimizelySDK.sln
README.md
keypair.snk
pull_request_template.md

README.md

Optimizely C# SDK

Semantic Build Status NuGet Apache 2.0

This repository houses the .Net based C# SDK for Optimizely Full Stack.

Getting Started

Installing the SDK

The SDK can be installed through NuGet:

PM> Install-Package Optimizely.SDK

An ASP.Net MVC sample project demonstrating how to use the SDK is available as well:

PM> Install-Package Optimizely.SDK.Sample

Simply compile and run the Sample application to see it in use. Note that the way the Demo App stores data in memory is not recommended for production use and is merely illustrates how to use the SDK.

Using the SDK

Documentation

See the Optimizely Full Stack developer documentation to learn how to set up your first Full Stack project and use the SDK.

Initialization

Create the Optimizely Client, for example:

private static Optimizely Optimizely =
    new Optimizely(
        datafile: myProjectConfig,
        eventDispatcher: myEventDispatcher,
        logger: myLogger,
        errorHandler: myErrorHandler,
        skipJsonValidation: false);

Since this class parses the Project Config file, you should not create this per request.

APIs

This class exposes three main calls:

  1. Activate
  2. Track
  3. GetVariation

Activate and Track are used in the demonstration app. See the Optimizely documentation regarding how to use these.

Plug-in Interfaces

The Optimizely client object accepts the following plug-ins:

  1. IEventDispatcher handles the HTTP requests to Optimizely. The default implementation is an asynchronous "fire and forget".
  2. ILogger exposes a single method, Log, to record activity in the SDK. An example of a class to bridge the SDK's Log to Log4Net is provided in the Demo Application.
  3. IErrorHandler allows you to implement custom logic when Exceptions are thrown. Note that Exception information is already included in the Log.

These are optional plug-ins and default behavior is implement if none are provided.

Development

Unit tests

The sample project contains unit tests as well which can be run from the built-in Visual Studio Test Runner.

Contributing

Please see CONTRIBUTING.

Third Party Licenses

Optimizely SDK uses third party software: murmurhash-signed, Newtonsoft.Json, and NJsonSchema.

You can’t perform that action at this time.