diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index eb7e486..3a4a238 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -25,3 +25,5 @@ jobs:
run: cd splitio_android/; flutter test
- name: Run flutter splitio_ios test
run: cd splitio_ios/; flutter test
+ - name: Run flutter splitio_web test
+ run: cd splitio_web/; flutter test --platform=chrome
diff --git a/splitio/CHANGELOG.md b/splitio/CHANGELOG.md
index 3ed9258..057ee4c 100644
--- a/splitio/CHANGELOG.md
+++ b/splitio/CHANGELOG.md
@@ -1,3 +1,13 @@
+# 1.0.0 (Aug 14, 2025)
+- Updated Android SDK to `5.3.1` & iOS SDK to `3.3.2`
+- Added support for rule-based segments. These segments determine membership at runtime by evaluating their configured rules against the user attributes provided to the SDK.
+- Added support for feature flag prerequisites. This allows customers to define dependency conditions between flags, which are evaluated before any allowlists or targeting rules.
+- Added two new configuration options to control the behavior of the persisted rollout plan cache. Use `rolloutCacheConfiguration` in the config.
+- Added a new optional argument to the client `getTreatment` methods to allow passing additional evaluation options, such as a map of properties to append to the generated impressions sent to Split backend. Read more in our docs.
+- Added support for the new impressions tracking toggle available on feature flags, both respecting the setting and including the new field being returned on SplitView type objects. Read more in our docs.
+
+# 1.0.0-rc.1 (Aug 14, 2025)
+
# 0.2.0 (Nov 6, 2024)
* Added support for targeting rules based on large segments.
* BREAKING CHANGE (for Split Proxy users):
diff --git a/splitio/example/pubspec.lock b/splitio/example/pubspec.lock
index 624c7f2..31b9465 100644
--- a/splitio/example/pubspec.lock
+++ b/splitio/example/pubspec.lock
@@ -75,30 +75,35 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
+ flutter_web_plugins:
+ dependency: transitive
+ description: flutter
+ source: sdk
+ version: "0.0.0"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
- sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
+ sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
url: "https://pub.dev"
source: hosted
- version: "10.0.9"
+ version: "11.0.2"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
- sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
+ sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
url: "https://pub.dev"
source: hosted
- version: "3.0.9"
+ version: "3.0.10"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
- sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
+ sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
url: "https://pub.dev"
source: hosted
- version: "3.0.1"
+ version: "3.0.2"
lints:
dependency: transitive
description:
@@ -127,10 +132,10 @@ packages:
dependency: transitive
description:
name: meta
- sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
+ sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
url: "https://pub.dev"
source: hosted
- version: "1.16.0"
+ version: "1.17.0"
path:
dependency: transitive
description:
@@ -166,28 +171,38 @@ packages:
path: ".."
relative: true
source: path
- version: "1.0.0-rc.1"
+ version: "1.0.0"
splitio_android:
dependency: transitive
description:
- path: "../../splitio_android"
- relative: true
- source: path
- version: "1.0.0-rc.1"
+ name: splitio_android
+ sha256: "344bf82de6694cffb8dd80a96ee734e31bb838d2b4693fb046e0fc98e31512ca"
+ url: "https://pub.dev"
+ source: hosted
+ version: "1.0.0"
splitio_ios:
dependency: transitive
description:
- path: "../../splitio_ios"
- relative: true
- source: path
- version: "1.0.0-rc.1"
+ name: splitio_ios
+ sha256: "1c078bc49bf7b30df6ca50accb6a9eecf592ec607e20e77b1c6ecdabc7a44dc9"
+ url: "https://pub.dev"
+ source: hosted
+ version: "1.0.0"
splitio_platform_interface:
dependency: transitive
description:
- path: "../../splitio_platform_interface"
+ name: splitio_platform_interface
+ sha256: "8bcb1cab9f5fffb7b79cfeeaf6c80d82f8ede55c8d6ca7578ec78653f3f9e499"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.0.0"
+ splitio_web:
+ dependency: transitive
+ description:
+ path: "../../splitio_web"
relative: true
source: path
- version: "2.0.0-rc.1"
+ version: "1.0.0"
stack_trace:
dependency: transitive
description:
@@ -224,18 +239,18 @@ packages:
dependency: transitive
description:
name: test_api
- sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
+ sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
url: "https://pub.dev"
source: hosted
- version: "0.7.4"
+ version: "0.7.7"
vector_math:
dependency: transitive
description:
name: vector_math
- sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
+ sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
url: "https://pub.dev"
source: hosted
- version: "2.1.4"
+ version: "2.2.0"
vm_service:
dependency: transitive
description:
@@ -244,6 +259,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "15.0.0"
+ web:
+ dependency: transitive
+ description:
+ name: web
+ sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
+ url: "https://pub.dev"
+ source: hosted
+ version: "0.5.1"
sdks:
- dart: ">=3.7.0-0 <4.0.0"
+ dart: ">=3.8.0-0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
diff --git a/splitio/example/web/favicon.png b/splitio/example/web/favicon.png
new file mode 100644
index 0000000..8aaa46a
Binary files /dev/null and b/splitio/example/web/favicon.png differ
diff --git a/splitio/example/web/icons/Icon-192.png b/splitio/example/web/icons/Icon-192.png
new file mode 100644
index 0000000..b749bfe
Binary files /dev/null and b/splitio/example/web/icons/Icon-192.png differ
diff --git a/splitio/example/web/icons/Icon-512.png b/splitio/example/web/icons/Icon-512.png
new file mode 100644
index 0000000..88cfd48
Binary files /dev/null and b/splitio/example/web/icons/Icon-512.png differ
diff --git a/splitio/example/web/icons/Icon-maskable-192.png b/splitio/example/web/icons/Icon-maskable-192.png
new file mode 100644
index 0000000..eb9b4d7
Binary files /dev/null and b/splitio/example/web/icons/Icon-maskable-192.png differ
diff --git a/splitio/example/web/icons/Icon-maskable-512.png b/splitio/example/web/icons/Icon-maskable-512.png
new file mode 100644
index 0000000..d69c566
Binary files /dev/null and b/splitio/example/web/icons/Icon-maskable-512.png differ
diff --git a/splitio/example/web/index.html b/splitio/example/web/index.html
new file mode 100644
index 0000000..6d72a53
--- /dev/null
+++ b/splitio/example/web/index.html
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ splitio_example
+
+
+
+
+
+
+
diff --git a/splitio/example/web/manifest.json b/splitio/example/web/manifest.json
new file mode 100644
index 0000000..142b95a
--- /dev/null
+++ b/splitio/example/web/manifest.json
@@ -0,0 +1,35 @@
+{
+ "name": "splitio_example",
+ "short_name": "splitio_example",
+ "start_url": ".",
+ "display": "standalone",
+ "background_color": "#0175C2",
+ "theme_color": "#0175C2",
+ "description": "A new Flutter project.",
+ "orientation": "portrait-primary",
+ "prefer_related_applications": false,
+ "icons": [
+ {
+ "src": "icons/Icon-192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "icons/Icon-512.png",
+ "sizes": "512x512",
+ "type": "image/png"
+ },
+ {
+ "src": "icons/Icon-maskable-192.png",
+ "sizes": "192x192",
+ "type": "image/png",
+ "purpose": "maskable"
+ },
+ {
+ "src": "icons/Icon-maskable-512.png",
+ "sizes": "512x512",
+ "type": "image/png",
+ "purpose": "maskable"
+ }
+ ]
+}
diff --git a/splitio/pubspec.yaml b/splitio/pubspec.yaml
index 634f85e..c7d1672 100644
--- a/splitio/pubspec.yaml
+++ b/splitio/pubspec.yaml
@@ -1,7 +1,6 @@
-publish_to: none # TODO
name: splitio
description: Official plugin for split.io, the platform for controlled rollouts, which serves features to your users via feature flags to manage your complete customer experience.
-version: 1.0.0-rc.1
+version: 1.0.0
homepage: https://split.io/
repository: https://github.com/splitio/flutter-sdk-plugin/tree/main/splitio/
@@ -16,16 +15,17 @@ flutter:
default_package: splitio_android
ios:
default_package: splitio_ios
+ web:
+ default_package: splitio_web
dependencies:
flutter:
sdk: flutter
- splitio_android: # ^1.0.0-rc.1
- path: ../splitio_android
- splitio_ios: # ^1.0.0-rc.1
- path: ../splitio_ios
- splitio_platform_interface: # ^2.0.0-rc.1
- path: ../splitio_platform_interface
+ splitio_android: ^1.0.0
+ splitio_ios: ^1.0.0
+ splitio_web: # ^1.0.0
+ path: ../splitio_web # @TODO remove when splitio_web is published
+ splitio_platform_interface: ^2.0.0
dev_dependencies:
flutter_test:
sdk: flutter
diff --git a/splitio_android/CHANGELOG.md b/splitio_android/CHANGELOG.md
index 4093fab..6f47087 100644
--- a/splitio_android/CHANGELOG.md
+++ b/splitio_android/CHANGELOG.md
@@ -1,3 +1,8 @@
+# 1.0.0 (Aug 14, 2025)
+- Updated Android SDK to `5.3.1`.
+
+# 1.0.0-rc.1 (Aug 14, 2025)
+
# 0.2.0 (Nov 6, 2024)
* Updated Android SDK to `5.0.0`
diff --git a/splitio_android/pubspec.yaml b/splitio_android/pubspec.yaml
index 05d4e96..fc2bbbe 100644
--- a/splitio_android/pubspec.yaml
+++ b/splitio_android/pubspec.yaml
@@ -1,7 +1,7 @@
name: splitio_android
description: The official Android implementation of splitio Flutter plugin.
repository: https://github.com/splitio/flutter-sdk-plugin/tree/main/splitio_android
-version: 1.0.0-rc.1
+version: 1.0.0
environment:
sdk: ">=2.16.2 <4.0.0"
@@ -19,8 +19,7 @@ flutter:
dependencies:
flutter:
sdk: flutter
- splitio_platform_interface: # ^2.0.0-rc.1
- path: ../splitio_platform_interface
+ splitio_platform_interface: ^2.0.0
dev_dependencies:
flutter_test:
diff --git a/splitio_ios/CHANGELOG.md b/splitio_ios/CHANGELOG.md
index d8e08de..d0935b9 100644
--- a/splitio_ios/CHANGELOG.md
+++ b/splitio_ios/CHANGELOG.md
@@ -1,3 +1,8 @@
+# 1.0.0 (Aug 14, 2025)
+- iOS SDK to `3.3.2`
+
+# 1.0.0-rc.1 (Aug 14, 2025)
+
# 0.2.0 (Nov 6, 2024)
* Updated iOS SDK to `3.0.0`
diff --git a/splitio_ios/pubspec.yaml b/splitio_ios/pubspec.yaml
index ae0269e..8c6637b 100644
--- a/splitio_ios/pubspec.yaml
+++ b/splitio_ios/pubspec.yaml
@@ -1,7 +1,7 @@
name: splitio_ios
description: The official iOS implementation of splitio Flutter plugin.
repository: https://github.com/splitio/flutter-sdk-plugin/tree/main/splitio_ios
-version: 1.0.0-rc.1
+version: 1.0.0
environment:
sdk: ">=2.16.2 <4.0.0"
@@ -18,8 +18,7 @@ flutter:
dependencies:
flutter:
sdk: flutter
- splitio_platform_interface: # ^2.0.0-rc.1
- path: ../splitio_platform_interface
+ splitio_platform_interface: ^2.0.0
dev_dependencies:
flutter_test:
diff --git a/splitio_platform_interface/CHANGELOG.md b/splitio_platform_interface/CHANGELOG.md
index 3e5e7e1..cf67b5e 100644
--- a/splitio_platform_interface/CHANGELOG.md
+++ b/splitio_platform_interface/CHANGELOG.md
@@ -1,3 +1,7 @@
+# 2.0.0 (Aug 14, 2025)
+
+# 2.0.0-rc.1 (Aug 14, 2025)
+
# 1.5.0 (Oct 18, 2024)
* Added certificate pinning functionality. This feature allows you to pin a certificate to the SDK, ensuring that the SDK only communicates with servers that present this certificate. Read more in our documentation.
diff --git a/splitio_platform_interface/lib/split_configuration.dart b/splitio_platform_interface/lib/split_configuration.dart
index ffe9a9d..1d54fdd 100644
--- a/splitio_platform_interface/lib/split_configuration.dart
+++ b/splitio_platform_interface/lib/split_configuration.dart
@@ -21,7 +21,7 @@ class SplitConfiguration {
///
/// [eventFlushInterval] When using .track, how often the events queue is flushed to Split servers.
///
- /// [eventsPerPush] Maximum size of the batch to push events.
+ /// [eventsPerPush] Maximum size of the batch to push events. Not supported in Web.
///
/// [trafficType] The default traffic type for events tracked using the track method. If not specified, every track call should specify a traffic type.
///
@@ -29,7 +29,7 @@ class SplitConfiguration {
///
/// [streamingEnabled] Boolean flag to enable the streaming service as default synchronization mechanism when in foreground. In the event of an issue with streaming, the SDK will fallback to the polling mechanism. If false, the SDK will poll for changes as usual without attempting to use streaming.
///
- /// [persistentAttributesEnabled] Enables saving attributes on persistent cache which is loaded as part of the SDK_READY_FROM_CACHE flow. All functions that mutate the stored attributes map affect the persistent cache.
+ /// [persistentAttributesEnabled] Enables saving attributes on persistent cache which is loaded as part of the SDK_READY_FROM_CACHE flow. All functions that mutate the stored attributes map affect the persistent cache. Not supported in Web.
///
/// [impressionListener] Enables impression listener. If true, generated impressions will be streamed in the impressionsStream() method of Splitio.
///
@@ -41,13 +41,13 @@ class SplitConfiguration {
///
/// [userConsent] User consent status used to control the tracking of events and impressions. Possible values are [UserConsent.granted], [UserConsent.declined], and [UserConsent.unknown].
///
- /// [encryptionEnabled] If set to true, the local database contents is encrypted. Defaults to false.
+ /// [encryptionEnabled] If set to true, the local database contents is encrypted. Defaults to false. Not supported in Web.
///
/// [logLevel] Enables logging according to the level specified. Options are [SplitLogLevel.verbose], [SplitLogLevel.none], [SplitLogLevel.debug], [SplitLogLevel.info], [SplitLogLevel.warning], and [SplitLogLevel.error].
///
/// [readyTimeout] Maximum amount of time in seconds to wait before firing the SDK_READY_TIMED_OUT event. Defaults to 10 seconds.
///
- /// [certificatePinningConfiguration] Certificate pinning configuration. Pins need to have the format of a base64 SHA-256 or base64 SHA-1 hashes of the SPKI (ex.: "sha256/7HIpactkIAq2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y=").
+ /// [certificatePinningConfiguration] Certificate pinning configuration. Pins need to have the format of a base64 SHA-256 or base64 SHA-1 hashes of the SPKI (ex.: "sha256/7HIpactkIAq2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y="). Not supported in Web.
SplitConfiguration({
int? featuresRefreshRate,
int? segmentsRefreshRate,
diff --git a/splitio_platform_interface/lib/split_view.dart b/splitio_platform_interface/lib/split_view.dart
index 9cc2916..8908cf6 100644
--- a/splitio_platform_interface/lib/split_view.dart
+++ b/splitio_platform_interface/lib/split_view.dart
@@ -32,7 +32,7 @@ class SplitView {
this.impressionsDisabled = false,
this.prerequisites = const {}]);
- static SplitView? fromEntry(Map? entry) {
+ static SplitView? fromEntry(Map? entry) {
if (entry == null || entry.isEmpty) {
return null;
}
diff --git a/splitio_platform_interface/pubspec.yaml b/splitio_platform_interface/pubspec.yaml
index 3465a95..6b2a0e1 100644
--- a/splitio_platform_interface/pubspec.yaml
+++ b/splitio_platform_interface/pubspec.yaml
@@ -2,7 +2,7 @@ name: splitio_platform_interface
description: A common platform interface for the splitio plugin.
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
-version: 2.0.0-rc.1
+version: 2.0.0
repository: https://github.com/splitio/flutter-sdk-plugin/tree/main/splitio_platform_interface
environment:
diff --git a/splitio_web/.gitignore b/splitio_web/.gitignore
new file mode 100644
index 0000000..9be145f
--- /dev/null
+++ b/splitio_web/.gitignore
@@ -0,0 +1,29 @@
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
+.DS_Store
+.atom/
+.buildlog/
+.history
+.svn/
+
+# IntelliJ related
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# The .vscode folder contains launch configuration and tasks you configure in
+# VS Code which you may wish to be included in version control, so this line
+# is commented out by default.
+#.vscode/
+
+# Flutter/Dart/Pub related
+# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
+/pubspec.lock
+**/doc/api/
+.dart_tool/
+.packages
+build/
diff --git a/splitio_web/LICENSE b/splitio_web/LICENSE
new file mode 100644
index 0000000..af74bff
--- /dev/null
+++ b/splitio_web/LICENSE
@@ -0,0 +1,191 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ Copyright © 2025 Split Software, Inc.
+
+ 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
+
+ http://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.
diff --git a/splitio_web/lib/splitio_web.dart b/splitio_web/lib/splitio_web.dart
new file mode 100644
index 0000000..b7bcdf2
--- /dev/null
+++ b/splitio_web/lib/splitio_web.dart
@@ -0,0 +1,416 @@
+import 'dart:async';
+import 'dart:js_interop';
+import 'dart:js_interop_unsafe';
+import 'package:flutter_web_plugins/flutter_web_plugins.dart' show Registrar;
+import 'package:splitio_platform_interface/splitio_platform_interface.dart';
+import 'package:splitio_web/src/js_interop.dart';
+import 'package:web/web.dart';
+
+extension on Window {
+ @JS()
+ external JS_BrowserSDKPackage? splitio;
+}
+
+/// Web implementation of [SplitioPlatform].
+class SplitioWeb extends SplitioPlatform {
+ /// Registers this class as the default platform implementation.
+ static void registerWith(Registrar registrar) {
+ SplitioPlatform.instance = SplitioWeb();
+ }
+
+ // Future to queue method calls until SDK is initialized
+ Future? _initFuture;
+
+ late JS_IBrowserSDK _factory;
+ String? _trafficType;
+ bool _impressionListener = false;
+
+ final Map _clients = {};
+
+ @override
+ Future init({
+ required String apiKey,
+ required String matchingKey,
+ required String? bucketingKey,
+ SplitConfiguration? sdkConfiguration,
+ }) async {
+ if (_initFuture == null) {
+ _initFuture = this._init(
+ apiKey: apiKey,
+ matchingKey: matchingKey,
+ bucketingKey: bucketingKey,
+ sdkConfiguration: sdkConfiguration);
+ }
+ return _initFuture;
+ }
+
+ Future _init({
+ required String apiKey,
+ required String matchingKey,
+ required String? bucketingKey,
+ SplitConfiguration? sdkConfiguration,
+ }) async {
+ await _loadSplitSdk();
+
+ final config =
+ _buildConfig(apiKey, matchingKey, bucketingKey, sdkConfiguration);
+
+ // Create factory instance
+ this._factory = window.splitio!.SplitFactory.callAsFunction(null, config)
+ as JS_IBrowserSDK;
+
+ if (sdkConfiguration != null) {
+ if (sdkConfiguration.configurationMap['trafficType'] is String) {
+ this._trafficType = sdkConfiguration.configurationMap['trafficType'];
+ }
+
+ if (sdkConfiguration.configurationMap['impressionListener'] is bool) {
+ this._impressionListener =
+ sdkConfiguration.configurationMap['impressionListener'];
+ }
+
+ // Log warnings regarding unsupported configs. Not done in _buildConfig to reuse the factory logger
+ final unsupportedConfigs = [
+ 'certificatePinningConfiguration',
+ 'encryptionEnabled',
+ 'eventsPerPush',
+ 'persistentAttributesEnabled'
+ ];
+ for (final configName in unsupportedConfigs) {
+ if (sdkConfiguration.configurationMap[configName] != null) {
+ this._factory.settings.log.warn.callAsFunction(
+ this._factory.settings.log,
+ 'Config $configName is not supported by the Web package. This config will be ignored.'
+ .toJS);
+ }
+ }
+ }
+
+ return;
+ }
+
+ // Checks whether the Split Browser SDK was manually loaded (`window.splitio != null`).
+ // If not, loads it by injecting a script tag.
+ static Future _loadSplitSdk() async {
+ if (window.splitio != null) {
+ return; // Already loaded
+ }
+
+ // Create and inject script tag
+ final script = document.createElement('script') as HTMLScriptElement;
+ script.type = 'text/javascript';
+ script.src = 'packages/splitio_web/web/split-browser-1.6.0.full.min.js';
+
+ // Wait for script to load
+ final completer = Completer();
+
+ script.onload = (Event event) {
+ completer.complete();
+ }.toJS;
+
+ script.onerror = (Event event) {
+ completer.completeError(
+ Exception('Failed to load Split SDK, with error: $event'));
+ }.toJS;
+
+ document.head!.appendChild(script);
+
+ await completer.future;
+
+ if (window.splitio == null) {
+ throw Exception('Split Browser SDK failed to initialize after loading');
+ }
+ }
+
+ // Map SplitConfiguration to JS equivalent object
+ static JSObject _buildConfig(String apiKey, String matchingKey,
+ String? bucketingKey, SplitConfiguration? configuration) {
+ final config = JSObject();
+
+ final core = JSObject();
+ core.setProperty('authorizationKey'.toJS, apiKey.toJS);
+ core.setProperty('key'.toJS, _buildKey(matchingKey, bucketingKey));
+ config.setProperty('core'.toJS, core);
+
+ if (configuration != null) {
+ final scheduler = JSObject();
+ if (configuration.configurationMap.containsKey('featuresRefreshRate'))
+ scheduler.setProperty(
+ 'featuresRefreshRate'.toJS,
+ (configuration.configurationMap['featuresRefreshRate'] as int)
+ .toJS);
+ if (configuration.configurationMap.containsKey('segmentsRefreshRate'))
+ scheduler.setProperty(
+ 'segmentsRefreshRate'.toJS,
+ (configuration.configurationMap['segmentsRefreshRate'] as int)
+ .toJS);
+ if (configuration.configurationMap.containsKey('impressionsRefreshRate'))
+ scheduler.setProperty(
+ 'impressionsRefreshRate'.toJS,
+ (configuration.configurationMap['impressionsRefreshRate'] as int)
+ .toJS);
+ if (configuration.configurationMap.containsKey('telemetryRefreshRate'))
+ scheduler.setProperty(
+ 'telemetryRefreshRate'.toJS,
+ (configuration.configurationMap['telemetryRefreshRate'] as int)
+ .toJS);
+ if (configuration.configurationMap.containsKey('eventsQueueSize'))
+ scheduler.setProperty('eventsQueueSize'.toJS,
+ (configuration.configurationMap['eventsQueueSize'] as int).toJS);
+ if (configuration.configurationMap.containsKey('impressionsQueueSize'))
+ scheduler.setProperty(
+ 'impressionsQueueSize'.toJS,
+ (configuration.configurationMap['impressionsQueueSize'] as int)
+ .toJS);
+ if (configuration.configurationMap.containsKey('eventFlushInterval'))
+ scheduler.setProperty('eventsPushRate'.toJS,
+ (configuration.configurationMap['eventFlushInterval'] as int).toJS);
+ config.setProperty('scheduler'.toJS, scheduler);
+
+ if (configuration.configurationMap.containsKey('streamingEnabled'))
+ config.setProperty('streamingEnabled'.toJS,
+ (configuration.configurationMap['streamingEnabled'] as bool).toJS);
+
+ final urls = JSObject();
+ if (configuration.configurationMap.containsKey('sdkEndpoint'))
+ urls.setProperty('sdk'.toJS,
+ (configuration.configurationMap['sdkEndpoint'] as String).toJS);
+ if (configuration.configurationMap.containsKey('eventsEndpoint'))
+ urls.setProperty('events'.toJS,
+ (configuration.configurationMap['eventsEndpoint'] as String).toJS);
+ if (configuration.configurationMap.containsKey('authServiceEndpoint'))
+ urls.setProperty(
+ 'auth'.toJS,
+ (configuration.configurationMap['authServiceEndpoint'] as String)
+ .toJS);
+ if (configuration.configurationMap
+ .containsKey('streamingServiceEndpoint'))
+ urls.setProperty(
+ 'streaming'.toJS,
+ (configuration.configurationMap['streamingServiceEndpoint']
+ as String)
+ .toJS);
+ if (configuration.configurationMap
+ .containsKey('telemetryServiceEndpoint'))
+ urls.setProperty(
+ 'telemetry'.toJS,
+ (configuration.configurationMap['telemetryServiceEndpoint']
+ as String)
+ .toJS);
+ config.setProperty('urls'.toJS, urls);
+
+ final sync = JSObject();
+ if (configuration.configurationMap['impressionsMode'] != null) {
+ sync.setProperty(
+ 'impressionsMode'.toJS,
+ (configuration.configurationMap['impressionsMode'] as String)
+ .toUpperCase()
+ .toJS);
+ }
+
+ if (configuration.configurationMap['syncEnabled'] != null) {
+ sync.setProperty('enabled'.toJS,
+ (configuration.configurationMap['syncEnabled'] as bool).toJS);
+ }
+
+ if (configuration.configurationMap['syncConfig'] != null) {
+ final syncConfig = configuration.configurationMap['syncConfig']
+ as Map>;
+ final List