{"id":19777935,"url":"https://github.com/datadome/datadome-flutter","last_synced_at":"2026-02-21T21:09:10.307Z","repository":{"id":48823465,"uuid":"335989667","full_name":"DataDome/datadome-flutter","owner":"DataDome","description":"Mobile SDK for DataDome for Flutter","archived":false,"fork":false,"pushed_at":"2024-12-05T13:53:54.000Z","size":230,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-13T02:10:10.308Z","etag":null,"topics":["flutter","mobile-sdk"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DataDome.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-04T15:04:32.000Z","updated_at":"2025-02-12T06:39:13.000Z","dependencies_parsed_at":"2024-11-12T05:27:24.421Z","dependency_job_id":"b74eb76a-36e1-47ad-aea6-0d70f7f102de","html_url":"https://github.com/DataDome/datadome-flutter","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDome%2Fdatadome-flutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDome%2Fdatadome-flutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDome%2Fdatadome-flutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDome%2Fdatadome-flutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataDome","download_url":"https://codeload.github.com/DataDome/datadome-flutter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253856656,"owners_count":21974582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flutter","mobile-sdk"],"created_at":"2024-11-12T05:27:10.870Z","updated_at":"2026-02-21T21:09:10.262Z","avatar_url":"https://github.com/DataDome.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DataDome Flutter Integration\n[![Pub](https://img.shields.io/pub/v/datadome.svg)](https://pub.dev/packages/datadome) ![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)\n\nDataDome Flutter plugin is an adaptation of the DataDome `iOS` and `Android` SDKs to Flutter. The plugin provides an interface to make networking requests to ensure your app networking layer is protected with DataDome.\nThe plugin is mapping the exposed interface to the underlying native SDKs using `URLSession` apis for iOS and `OkHttp` apis for Android.\nDisplaying the captcha, managing the cookies and handling the event tracker are all managed by the underlying native components.\n\n## Install the plugin\nTo install the plugin, add the `DataDome` dependency to your `pubspec.yaml` file as shown in the following\n\n```yml\ndependencies:\n  datadome: ^1.0.1\n  flutter:\n    sdk: flutter\n```\n\n\n**Note:** Make sure your project does support Swift/Kotlin. If not, enable Swift/Kotlin for your Flutter project by executing the following command\n\n```sh\nflutter create -i swift -a kotlin\n```\n\n**For iOS:**\n\nUpdate the `Info.plist` file of the iOS project under `ios/Runner/Info.plist`:\n\n1. Add a new entry with the key `DataDomeKey` and your DataDome client side key as value.\n2. Add a new entry with the key `DataDomeProxyEnabled` and NO as value (make sure the type of the entry is Boolean).\n\nNow the plugin is ready to be used.\n\n## Usage\nThe DataDome Flutter plugin provides a set of APIs to perform networking requests. The plugin will perform a request, intercept any signal from the DataDome remote protection module, display a captcha if relevent and then retry the failed request. \nThis is all managed by the DataDome client.\n\n### Initialize the DataDome client\nMake sure you create an instance of the DataDome client\n\n```dart\nDataDome client = DataDome('YOUR_DATADOME_CLIENT_SIDE_KEY');\n```\n\nDepending on the request type, use one of the following APIs from the client instance you just created.\n### Perform GET/DELETE requests\nUse the `get` or `delete` method from the DataDome client to perform the GET/DELETE request\n\n```dart\nFuture\u003chttp.Response\u003e get({\n    @required String url,\n    Map\u003cString, String\u003e headers = const {}\n}) async\n```\n\n```dart\nFuture\u003chttp.Response\u003e delete({\n    @required String url,\n    Map\u003cString, String\u003e headers = const {}\n}) async\n```\n\nThe method takes the following arguments:\n\n- **url** A string representation of the request URL.\n- **headers** An optional Map of header fields and values.\n\nThe method executes the request and return a `Response` instance from the [http package](https://pub.dev/packages/http)\n\nHere a **sample code** to perform a GET request\n\n```dart\n//importing needed packages\nimport 'package:datadome/datadome.dart';\nimport 'package:http/http.dart' as http;\n\n//creating the DataDome client\nDataDome client = DataDome('DATADOME_CLIENT_SIDE_KEY');\n\n//performing a GET request\nhttp.Response response = await client.get(url: 'https://datadome.co/wp-json');\n\n//using the response            \nprint('Response status: ${response.statusCode}');\nprint('Response headers: ${response.headers}');\nprint('Response body: ${response.body}');\n            \n```\n\n### Perform POST/PUT/PATCH requests\nUse one of the following methods from the DataDome client to perform the desired request\n\n**POST**\n\n```dart\nFuture\u003chttp.Response\u003e post({\n      @required String url,\n      Map\u003cString, String\u003e headers = const {},\n      body\n}) async\n```\n\n**PUT**\n\n```dart\nFuture\u003chttp.Response\u003e put({\n      @required String url,\n      Map\u003cString, String\u003e headers = const {},\n      body\n}) async\n```\n\n**PATCH**\n\n```dart\nFuture\u003chttp.Response\u003e patch({\n      @required String url,\n      Map\u003cString, String\u003e headers = const {},\n      body\n}) async\n```\n\nThe above methods take the following arguments:\n\n- **url** A string representation of the request URL.\n- **headers** An optional Map of header fields and values.\n- **body** The request body in List or Map data types.\n\nThe method executes the request and return a `Response` instance from the [http package](https://pub.dev/packages/http)\n\nHere a **sample code** to perform a POST request\n\n```dart\n//importing needed packages\nimport 'package:datadome/datadome.dart';\nimport 'package:http/http.dart' as http;\n\n//creating the DataDome client\nDataDome client = DataDome('DATADOME_CLIENT_SIDE_KEY');\n\n//performing a POST request\nhttp.Response response = await client.post(url: 'https://jsonplaceholder.typicode.com/posts', body: {'title': 'foo', 'body': 'bar', 'userId': '1'});\n\n//using the response            \nprint('Response status: ${response.statusCode}');\nprint('Response headers: ${response.headers}');\nprint('Response body: ${response.body}');\n            \n```\n\n## Forcing the Captcha display\n\nTo test and validate your integration, use a specific header to force the DataDome remote protection module to block the request and force the underlying native SDK to display the captcha. We use the `User-Agent` header with the value `BLOCKUA` to hint the remote module to block the request.\nPlease note that the captcha is displayed once and then the generated cookie is stored locally.\n\nHere a **sample code** to perform a GET request while forcing a captcha display\n\n```dart\n//importing needed packages\nimport 'package:datadome/datadome.dart';\nimport 'package:http/http.dart' as http;\n\n//creating the DataDome client\nDataDome client = DataDome('DATADOME_CLIENT_SIDE_KEY');\n\n//performing a GET request with the BLOCKUA User-Agent header\nhttp.Response response = await client.get(url: 'https://datadome.co/wp-json', headers: {'User-Agent': 'BLOCKUA'});\n\n//using the response            \nprint('Response status: ${response.statusCode}');\nprint('Response headers: ${response.headers}');\nprint('Response body: ${response.body}');\n            \n```\n\n**IMPORTANT** Do not leave this header in production. This will lead all users to see a captcha at least once.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadome%2Fdatadome-flutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatadome%2Fdatadome-flutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadome%2Fdatadome-flutter/lists"}