Skip to content

[FSSDK-8962] doc: change full stack to feature experimentation #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 10, 2023
Merged
45 changes: 45 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Contributing to the Optimizely Flutter SDK
We welcome contributions and feedback! All contributors must sign our [Contributor License Agreement (CLA)](https://docs.google.com/a/optimizely.com/forms/d/e/1FAIpQLSf9cbouWptIpMgukAKZZOIAhafvjFCV8hS00XJLWQnWDFtwtA/viewform) to be eligible to contribute. Please read the [README](README.md) to set up your development environment, then read the guidelines below for information on submitting your code.

## Development process

1. Fork the repository and create your branch from master.
2. Please follow the [commit message guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines) for each commit message.
3. Make sure to add tests!
4. `git push` your changes to GitHub.
5. Open a PR from your fork into the master branch of the original repo.
6. Make sure that all unit tests are passing and that there are no merge conflicts between your branch and `master`.
7. Open a pull request from `YOUR_NAME/branch_name` to `master`.
8. A repository maintainer will review your pull request and, if all goes well, squash and merge it!

## Pull request acceptance criteria

* **All code must have test coverage.** Changes in functionality should have accompanying unit tests. Bug fixes should have accompanying regression tests.
* Tests are located in `OptimizelySDK.Tests` with one file per class.

## License

All contributions are under the CLA mentioned above. For this project, Optimizely uses the Apache 2.0 license, and so asks that by contributing your code, you agree to license your contribution under the terms of the [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0). Your contributions should also include the following header:

```
/// **************************************************************************
/// Copyright YEAR, Optimizely, Inc. and contributors *
/// *
/// Licensed under the Apache License, Version 2.0 (the "License"); *
/// you may not use this file except in compliance with the License. *
/// You may obtain a copy of the License at *
/// *
/// https://www.apache.org/licenses/LICENSE-2.0 *
/// *
/// Unless required by applicable law or agreed to in writing, software *
/// distributed under the License is distributed on an "AS IS" BASIS, *
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
/// See the License for the specific language governing permissions and *
/// limitations under the License. *
///**************************************************************************/
```

The YEAR above should be the year of the contribution. If work on the file has been done over multiple years, list each year in the section above. Example: Optimizely writes the file and releases it in 2014. No changes are made in 2015. Change made in 2016. YEAR should be �2014, 2016�.

## Contact
If you have questions, please contact [email protected].

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this email still used and monitored by us?

91 changes: 67 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# Optimizely Flutter SDK
[![Pub Version](https://img.shields.io/pub/v/optimizely_flutter_sdk?color=blueviolet)](https://pub.dev/packages/optimizely_flutter_sdk)
[![Pub](https://img.shields.io/pub/v/optimizely_flutter_sdk.svg)](https://pub.dev/packages/optimizely_flutter_sdk)
[![Apache 2.0](https://img.shields.io/github/license/nebula-plugins/gradle-extra-configurations-plugin.svg)](https://www.apache.org/licenses/LICENSE-2.0)
<!-- TODO: Resolve FSSDK-8990 to fix coverage & thus build, then return these 2 bades as #2 & # above
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<!-- TODO: Resolve FSSDK-8990 to fix coverage & thus build, then return these 2 bades as #2 & # above
<!-- TODO: Resolve FSSDK-8990 to fix coverage & thus build, then return these 2 badges as #2 & # above

[![Build Status](https://github.com/optimizely/optimizely-flutter-sdk/actions/workflows/flutter.yml/badge.svg?branch=master)](https://github.com/optimizely/optimizely-flutter-sdk/actions)
[![Pub](https://img.shields.io/pub/v/optimizely_flutter_sdk.svg)](https://pub.dev/packages/optimizely_flutter_sdk)
[![Coverage Status](https://coveralls.io/repos/github/optimizely/optimizely-flutter-sdk/badge.svg?branch=master)](https://coveralls.io/github/optimizely/optimizely-flutter-sdk?branch=master)
-->

This repository houses the Flutter SDK for use with Optimizely Feature Experimentation and Optimizely Full Stack (legacy).

Optimizely Feature Experimentation is an A/B testing and feature management tool for product development teams that enables you to experiment at every step. Using Optimizely Feature Experimentation allows for every feature on your roadmap to be an opportunity to discover hidden insights. Learn more at [Optimizely.com](https://www.optimizely.com/products/experiment/feature-experimentation/), or see the [developer documentation](https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/welcome).

This project is a starting point for a Flutter
[plug-in package](https://flutter.dev/developing-packages/),
a specialized package that includes platform-specific implementation code for
Android and/or iOS.
Optimizely Rollouts is [free feature flags](https://www.optimizely.com/free-feature-flagging/) for development teams. You can easily roll out and roll back features in any application without code deploys, mitigating risk for every feature on your roadmap.

## Getting Started
## Get Started

### Using the SDK
Refer to the [Flutter SDK developer documentation](https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/install-sdk-flutter) for instructions on getting started with using the SDK.
Refer to the [Flutter SDK's developer documentation](https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/flutter-sdk) for detailed instructions on getting started with using the SDK.

### Requirements

Expand All @@ -24,51 +27,91 @@ On the iOS platform, the SDK requires a minimum version of 10.0.

Other Flutter platforms are not currently supported by this SDK.

### Installing the SDK
### Install the SDK

To add the flutter-sdk to your project dependencies, include the following in your app's pubspec.yaml:

```
optimizely_flutter_sdk: ^1.0.0-beta
optimizely_flutter_sdk: ^1.0.1-beta
```

Then, import the package in your application code:
Then run

```
import 'package:optimizely_flutter_sdk/optimizely_flutter_sdk.dart';
```bash
flutter pub get
```

## Usage
## Use the Flutter SDK

### Instantiation
### Initialization

A sample code for SDK initialization:
Import the package in your application code:

```dart
import 'package:optimizely_flutter_sdk/optimizely_flutter_sdk.dart';
```
var flutterSDK = OptimizelyFlutterSdk("my_sdk_key");

Instantiate the SDK, adding your SDK Key and initializing the client:

```dart
var flutterSDK = OptimizelyFlutterSdk("your_sdk_key");
var response = await flutterSDK.initializeClient();
```

### Feature Rollouts
```
```dart
import 'package:optimizely_flutter_sdk/optimizely_flutter_sdk.dart';

// Also supports eventOptions, datafilePeriodicDownloadInterval, datafileHostOptions and defaultDecideOptions
var flutterSDK = OptimizelyFlutterSdk("my_sdk_key");
var flutterSDK = OptimizelyFlutterSdk("your_sdk_key");

// instantiate a client
var response = await flutterSDK.initializeClient();

// User attributes are optional and used for targeting and results segmentation
var attributes = {
"state": "California",
"likes_donuts": true
};
var user = await flutterSDK.createUserContext("optimizely end user", attributes);
var user = await flutterSDK.createUserContext("user_id", attributes);
var decideReponse = await user!.decide("binary_feature");
```

## Testing in Terminal
## SDK Development

### Unit Tests

To run [unit tests](https://docs.flutter.dev/cookbook/testing/unit/introduction) using terminal, simply use the following command:

```bash
flutter test test/optimizely_flutter_sdk_test.dart
```

### Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md).

### Other Optimizely SDKs

- Agent - https://github.com/optimizely/agent

- Android - https://github.com/optimizely/android-sdk

- C# - https://github.com/optimizely/csharp-sdk

- Flutter - https://github.com/optimizely/optimizely-flutter-sdk

- Go - https://github.com/optimizely/go-sdk

- Java - https://github.com/optimizely/java-sdk

- JavaScript - https://github.com/optimizely/javascript-sdk

- PHP - https://github.com/optimizely/php-sdk

- Python - https://github.com/optimizely/python-sdk

- React - https://github.com/optimizely/react-sdk

- Ruby - https://github.com/optimizely/ruby-sdk

1. To run [unit tests](https://docs.flutter.dev/cookbook/testing/unit/introduction) using terminal, simply use the following command:
`flutter test test/optimizely_flutter_sdk_test.dart`
- Swift - https://github.com/optimizely/swift-sdk
2 changes: 1 addition & 1 deletion ios/optimizely_flutter_sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Pod::Spec.new do |s|
s.name = 'optimizely_flutter_sdk'
s.version = '0.0.1'
s.summary = 'Optimizely experiment framework for iOS'
s.homepage = "https://docs.developers.optimizely.com/full-stack/docs"
s.homepage = "https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs"
s.license = { :type => "Apache License, Version 2.0", :file => "../LICENSE" }
s.author = { "Optimizely" => "[email protected]" }
s.source = { :path => '.' }
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: optimizely_flutter_sdk
description: This repository houses the Flutter SDK for use with Optimizely Full Stack and Optimizely Rollouts.
description: This repository houses the Flutter SDK for use with Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts.
version: 1.0.0-beta
homepage: https://github.com/optimizely/optimizely-flutter-sdk

Expand Down