### Install Go SDK Source: https://docs.datadome.co/docs/account-protect-custom-events Get the Go SDK package using the go get command. ```bash go get github.com/datadome/fraud-sdk-go-package ``` -------------------------------- ### Install DataDome Go Module Source: https://docs.datadome.co/docs/go Use the `go get` command to install the DataDome Go package. Ensure you are using the correct version. ```shell go get github.com/datadome/module-go-package/v2 ``` -------------------------------- ### Install DataDome SDK with Dependencies Source: https://docs.datadome.co/docs/sdk-react-native-navigation Install the DataDome SDK along with its peer dependencies for a complete setup. ```bash npm install --save @datadome/datadome-react-native-navigation @react-native-async-storage/async-storage async-barrier react-native-webview react-native-navigation ``` -------------------------------- ### Setup MuleSoft Integration Dependencies Source: https://docs.datadome.co/docs/mulesoft Run this command to install required dependencies and prepare the environment for publishing the MuleSoft custom policy. ```bash make setup ``` -------------------------------- ### Install Python SDK Source: https://docs.datadome.co/docs/account-protect-custom-events Install the Python SDK using pip. ```bash pip install datadome-fraud-sdk-python ``` -------------------------------- ### Install Ruby SDK Source: https://docs.datadome.co/docs/account-protect-custom-events Install the Ruby SDK gem using the gem command. ```bash gem install datadome_fraud_sdk_ruby ``` -------------------------------- ### Install DataDome Go Module Source: https://docs.datadome.co/docs/module-go Install the DataDome Go module using the go get command. Ensure you are using Go version 1.20 or higher. ```shell go get github.com/datadome/module-go-package ``` -------------------------------- ### Install Node.js SDK Source: https://docs.datadome.co/docs/account-protect-custom-events Use this command to install the Node.js SDK package for your application. ```bash npm i @datadome/fraud-sdk-node ``` -------------------------------- ### Install with all dependencies Source: https://docs.datadome.co/docs/sdk-react-native-superagent Install the DataDome Superagent package along with its peer dependencies. ```bash npm install --save @datadome/datadome-superagent @react-native-async-storage/async-storage async-barrier react-native-webview superagent ``` -------------------------------- ### Install Symfony PHP SDK Source: https://docs.datadome.co/docs/account-protect-custom-events Install the Symfony PHP SDK using Composer. ```bash composer require datadome/fraud-sdk-symfony ``` -------------------------------- ### Install Laravel PHP SDK Source: https://docs.datadome.co/docs/account-protect-custom-events Install the Laravel PHP SDK and configure it by adding the service provider and publishing the configuration file. ```bash # 1. add `datadome/fraud-sdk-laravel` to your project composer require datadome/fraud-sdk-laravel # 2. Generate an autoloader composer dump-autoload # 3. Edit `config/app.php` to add `DataDomeServiceProvider` # config/app.php use DataDome\FraudSdkLaravel\Providers\DataDomeServiceProvider; [...] 'providers' => ServiceProvider::defaultProviders()->merge([ [...] DataDomeServiceProvider::class # 4. publish `datadome.php` in the `config` folder php artisan vendor:publish ``` -------------------------------- ### FastMCP Configuration Example Source: https://docs.datadome.co/docs/fastmcp An example of configuring the DataDome middleware with FastMCP, showing default values that can be modified. ```python from fastmcp import FastMCP from starlette.middleware import Middleware from datadome_asgi import DataDomeMiddleware # Create FastMCP application mcp = FastMCP() ``` -------------------------------- ### Install DataDome Nginx Plus Module from Source Source: https://docs.datadome.co/docs/module-nginx-plus Use this script to download Nginx and DataDome module sources, compile the dynamic module, and install it. Ensure you have Nginx installed to determine the correct source version. ```shell # Create a temporary directory to work in tmp_dir=$(mktemp -d -t datadome-XXXXXXXXXX) echo $tmp_dir # Get the Nginx version in use nginx_version=$(nginx -v 2>&1 | grep -oP 'nginx\/\K([0-9.]*)') echo $nginx_version # Download and untar the Nginx sources to compile dynamic module curl -sLo ${tmp_dir}/nginx-${nginx_version}.tar.gz http://nginx.org/download/nginx-${nginx_version}.tar.gz tar -C ${tmp_dir} -xzf ${tmp_dir}/nginx-${nginx_version}.tar.gz # Download and untar DataDome module sources curl -sLo ${tmp_dir}/datadome_nginx_module.tar.gz https://package.datadome.co/linux/DataDome-Nginx-latest.tgz tar -C ${tmp_dir} -zxf ${tmp_dir}/datadome_nginx_module.tar.gz # Get the name of the DataDome module directory datadome_dir=$(basename $(ls ${tmp_dir}/DataDome-NginxDome-* -d1)) # Launch the nginx configure script + the DataDome dynamic module cd ${tmp_dir}/nginx-${nginx_version} && eval "./configure --with-compat --add-dynamic-module=../${datadome_dir}" # Compile the modules make modules # Ensure Nginx module directory is created mkdir -p /etc/nginx/modules # Copy the .so modules to nginx configuration cp ${tmp_dir}/nginx-${nginx_version}/objs/ngx_http_data_dome_*.so /etc/nginx/modules/ # Then you have to add the following configuration to your nginx.conf file: # load_module /etc/nginx/modules/ngx_http_data_dome_auth_module.so; # load_module /etc/nginx/modules/ngx_http_data_dome_shield_module.so; # load_module /etc/nginx/modules/ngx_http_data_dome_upstream_dynamic_servers_module.so; # Ensure the modules are loaded correctly nginx -t ``` -------------------------------- ### Manual Installation Archive Link Source: https://docs.datadome.co/docs/module-javavertx-web Download the DataDome Java module archive from this link for manual installation. ```html https://package.datadome.co/linux/DataDome-Java-latest.tgz ``` -------------------------------- ### Instantiate Go SDK with Options Source: https://docs.datadome.co/docs/account-protect-custom-events Create a Go SDK client, providing the API key and configuring the endpoint and timeout using client options. ```go client, err := dd.NewClient( "FRAUD_API_KEY", dd.ClientWithEndpoint("account-api.datadome.co"), dd.ClientWithTimeout(1500), ) ``` -------------------------------- ### Instantiate Ruby SDK with Options Source: https://docs.datadome.co/docs/account-protect-custom-events Initialize the Ruby SDK with timeout, endpoint, and logger configuration. ```ruby datadome = DataDome.new(1500, 'https://account-api.datadome.co', config.logger) ``` -------------------------------- ### Start HTTP Server in Go Source: https://docs.datadome.co/docs/account-protect-login Set up an HTTP server to listen for login requests on port 8080 and route them to the `loginHandler`. ```go func main() { client, _ := dd.NewClient("FRAUD_API_KEY") mux := http.NewServeMux() mux.HandleFunc("/login", loginHandler(client)) _ = http.ListenAndServe(":8080", mux) } ``` -------------------------------- ### Varnish VCL Configuration Example Source: https://docs.datadome.co/docs/varnish An example VCL file demonstrating how to include the DataDome module. Ensure the 'include "datadome.vcl";' line is placed correctly within your VCL structure. ```text # # This is an example VCL file for Varnish. # # It does not do anything by default, delegating control to the # builtin VCL. The builtin VCL is called when there is no explicit # return statement. # # See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/ # and http://varnish-cache.org/trac/wiki/VCLExamples for more examples. # Marker to tell the VCL compiler that this VCL has been adapted to the # new 4.0 format. vcl 4.0; # Default backend definition. Set this to point to your content server. backend default { .host = "127.0.0.1"; .port = "80"; } include "datadome.vcl"; sub vcl_recv { # Happens before we check if we have this in cache already. # # Typically you clean up the request here, removing cookies you don't need, # rewriting the request, etc. } sub vcl_backend_response { # Happens after we have read the response headers from the backend. # # You can clean the response headers, removing silly Set-Cookie headers # and other mistakes your backend does. } sub vcl_deliver { # Happens when we have all the pieces we need, and are about to send the # response to the client. # # You can do accounting or modifying the final object here. } ``` -------------------------------- ### .NET Registration Event Validation Setup Source: https://docs.datadome.co/docs/account-protect-registration Configure the DataDome SDK in your .NET application by adding the API key to appsettings.json or environment variables and registering the service in Program.cs or Startup.cs. This example shows dependency injection for the SDK context. ```csharp // 1. Add your API Key in the appsettings.json, or as environment variables "DataDome": { "FraudAPIKey": "----" } // 2. In the Program.cs / Startup.cs add the DataDome SDK using DataDome.AspNetCore.Fraud.SDK; // Option 1: Passing in a reference to the configuration, for values in appsettings builder.Services.AddDataDome(builder.Configuration); // Option 2: Passing in the values directly, for environment variables builder.Services.AddDataDome(o => { o.FraudAPIKey = "FraudAPIKey"; }); // 3. Include IDataDomeContext as a dependency injection in the concerned controller using DataDome.AspNetCore.Fraud.SDK.Model.Shared; // ... private readonly SDK.IDataDomeContext _dataDome; private readonly RegistrationService _registrationService; public RegistrationController(SDK.IDataDomeContext dataDome, RegistrationService registrationService) { _dataDome = dataDome; _registrationService = registrationService; } [Route("SubmitRegister")] [HttpPost] public async Task SubmitRegister([FromForm] RegistrationUser user) { if (_registrationService.ValidateRegister(user)) { var address = new Address() { Name = "HQ", Line1 = "55 Rue du Faubourg Saint-Honoré", Line2 = "2nd floor", City = "Paris", CountryCode = "FR", RegionCode = "75", ZipCode = "75002", }; var newUser = new User() { Id = "userId", Title = "mrs", FirstName = "Data", LastName = "Dome", CreatedAt = DateTime.UtcNow, Phone = "+33978787878", Email = user.emailAccount, Address = address, }; var session = new Session() { Id = Guid.NewGuid().ToString("D"), CreatedAt = DateTime.UtcNow, }; var authentication = new Authentication() { Mode = AuthenticationMode.Password, SocialProvider = AuthenticationSocialProvider.Google, Type = AuthenticationType.Local } var registrationEvent = new RegistrationEvent(user.emailAccount, newUser, session, authentication); registrationEvent.PartnerId = "AA123456"; registrationEvent.AccountType = AccountType.Customer; /* sample of failReason registrationEvent.FailReason = RegistrationFailReason.DuplicatedAccount; */ var ddResponse = await _dataDome.Validate(Request, registrationEvent); if (ddResponse.Action == ResponseAction.Allow) { if (_authenticationService.RegisterUser(user)) { TempData["SuccessMessage"] = "Registered successfully, you can log in."; } else { TempData["ErrorMessage"] = "Error while registering, please try again."; } } else { TempData["ErrorMessage"] = "Registration blocked."; } } TempData["From"] = "register"; return RedirectToAction("Index"); } ``` -------------------------------- ### Instantiate Python SDK with Options Source: https://docs.datadome.co/docs/account-protect-custom-events Create an instance of the Python SDK, providing the fraud API key, timeout, and endpoint. ```python datadome_instance = DataDome("FraudAPIKey", timeout=1500, endpoint="https://account-api.datadome.co") ``` -------------------------------- ### Instantiate Java SDK with Options Source: https://docs.datadome.co/docs/account-protect-custom-events Initialize the Java SDK with a fraud API key, specifying the endpoint and timeout through options. ```java new DataDomeFraudService(datadomeFraudApiKey, DataDomeOptions.newBuilder() .endpoint("https://account-api.datadome.co") .timeout(1500) .build() ); ``` -------------------------------- ### .NET Core DataDome SDK Setup and Usage Source: https://docs.datadome.co/docs/account-protect-login Configure and use the DataDome SDK in your .NET Core application for login event validation. This example covers configuration via appsettings.json or environment variables, dependency injection, and invoking the `Validate` and `Collect` methods. ```csharp // 1. Add your API Key in the appsettings.json, or as environment variables "DataDome": { "FraudAPIKey": "----" } // 2. In the Program.cs / Startup.cs add the DataDome SDK using DataDome.AspNetCore.Fraud.SDK; // Option 1: Passing in a reference to the configuration, for values in appsettings builder.Services.AddDataDome(builder.Configuration); // Option 2: Passing in the values directly, for environment variables builder.Services.AddDataDome(o => { o.FraudAPIKey = "DataDomeParisNewYorkSingapore"; }); // 3. Include IDataDomeContext as a dependency injection in the concerned controller using DataDome.AspNetCore.Fraud.SDK.Model.Shared; // ... private readonly SDK.IDataDomeContext _dataDome; private readonly AuthenticationService _authenticationService; public LoginController(SDK.IDataDomeContext dataDome, AuthenticationService authenticationService) { _dataDome = dataDome; _authenticationService = authenticationService; } // 4. Invoke the DataDome Fraud API within the login business logic [Route("SubmitLogin")] [HttpPost] public async Task SubmitLogin([FromForm] LoginUser user) { if (_authenticationService.ValidateLogin(user)) { var ddResponse = await _dataDome.Validate(Request, new LoginEvent(user.Email)); if (ddResponse != null && ddResponse.ResponseAction == ResponseAction.Allow) { TempData["SuccessMessage"] = $ ``` ```csharp Welcome!"; return View("Success"); } else { // Business Logic here // MFA // Challenge // Notification email // Temporarily lock account } } else { await _dataDome.Collect(Request, new LoginEvent( user.Email, LoginStatus.Failed, new Authentication() { Mode = AuthenticationMode.Password, SocialProvider = AuthenticationSocialProvider.Google, Type = AuthenticationType.Local }, new User() { Id = user.Email, FirstName = user.Name, }, new Session { Id = Guid.NewGuid().ToString("D"), CreatedAt = DateTime.UtcNow, }, failReason: LoginFailReason.WrongPassword, accountType: AccountType.Customer ) { // Sample code for partnerId and custom fields PartnerId = user.PartnerId, CustomFields = new List { new CustomField("registration", "AA-123-EE") { Type = CustomFieldType.String, IsPii = false } ``` -------------------------------- ### Install .NET SDK Source: https://docs.datadome.co/docs/account-protect-custom-events Add the .NET SDK package to your project using the dotnet CLI. ```bash dotnet add package DataDome.AspNetCore.Fraud.SDK ``` -------------------------------- ### Install DataDome React Native Navigation SDK Source: https://docs.datadome.co/docs/sdk-react-native-navigation Install the DataDome SDK using npm. This command installs the core package. ```bash npm install @datadome/datadome-react-native-navigation --save ``` -------------------------------- ### Install React Native DataDome SDK Source: https://docs.datadome.co/docs/sdk-react-native-fetch Install the DataDome SDK and its dependency using npm. Ensure react-native-webview is also installed. ```bash npm install --save @datadome/react-native-datadome react-native-webview ``` -------------------------------- ### iOS Pod Installation for DataDome SDK Source: https://docs.datadome.co/docs/sdk-react-native-urql After installing the npm package, navigate to the 'ios' directory and run 'pod install' to complete the integration on iOS. ```shell cd ios/ pod install ``` -------------------------------- ### Configure DataDome Client with Functional Options Source: https://docs.datadome.co/docs/go This example demonstrates how to initialize the DataDome client using functional options to customize its behavior. It includes settings for endpoint, timeout, GraphQL support, referrer restoration, URL pattern exclusion and inclusion, X-Forwarded-Host header usage, and custom logging. ```go client, err := dd.NewClient( "Some key", dd.WithEndpoint("api.datadome.co"), dd.WithTimeout(150), dd.WithGraphQLSupport(true), dd.WithReferrerRestoration(true), dd.WithUrlPatternExclusion(`(?i)\.(avi|flv|mka|mkv|mov|mp4|mpeg|mpg|mp3|flac|ogg|ogm|opus|wav|webm|webp|bmp|gif|ico|jpeg|jpg|png|svg|svgz|swf|eot|otf|ttf|woff|woff2|css|less|js|map|json)$`), dd.WithUrlPatternInclusion(`(?i)\/included\/endpoint`), dd.WithXForwardedHost(true), dd.Logger(dd.NewDefaultLogger()), ) ``` -------------------------------- ### Install Nginx Module on CentOS RHEL 7 Source: https://docs.datadome.co/docs/nginx Use this repository to install the Nginx module on CentOS RHEL 7. Configuration remains the same after installation. ```shell cd /etc/yum.repos.d/ sudo wget https://download.opensuse.org/repositories/isv:/datadome/CentOS_7/isv:datadome.repo yum install nginx-datadome ``` -------------------------------- ### Initialize DataDome SDK in Ruby Source: https://docs.datadome.co/docs/account-protect-login Import the DataDome library and create an instance of the DataDome client. ```ruby require 'datadome_fraud_sdk_ruby' datadome = DataDome.new ``` -------------------------------- ### Install Anypoint CLI PDK Plugin Source: https://docs.datadome.co/docs/mulesoft Installs the Anypoint CLI plugin for the Policy Development Kit (PDK). Ensure you have Anypoint CLI v4 installed. ```bash anypoint-cli-v4 plugins:install anypoint-cli-pdk-plugin ``` -------------------------------- ### Install Nginx Module on AWS Linux 1 Source: https://docs.datadome.co/docs/nginx Use this repository to install the Nginx module on AWS Linux 1 AMI. After installation, configuration is the same as described elsewhere. ```text cd /etc/yum.repos.d/ sudo wget http://download.opensuse.org/repositories/isv:/datadome/CentOS_6/isv:datadome.repo yum install nginx-datadome ``` -------------------------------- ### Setup Varnish Source for Varnish 3.0 Source: https://docs.datadome.co/docs/varnish Prepares the Varnish 3.0 source code on the server, which is required for compiling the DataDome module with Varnish 3.0. ```shell wget https://varnish-cache.org/_downloads/varnish-3.0.7.tgz tar -zxvf varnish-3.0.7.tgz cd varnish-3.0.7 ./autogen.sh ./configure make export VARNISHSRC=$PWD ``` -------------------------------- ### Install datadome-superagent Source: https://docs.datadome.co/docs/sdk-react-native-superagent Install the DataDome Superagent package using npm. ```bash npm install @datadome/datadome-superagent --save ``` -------------------------------- ### Combine Example Source: https://docs.datadome.co/docs/sdk-ios-urlsession Example of using the DataDome protected publisher with Combine. ```APIDOC ## Combine Example ### Description An example demonstrating how to use the `protectedDataTaskPublisher` to make network requests with DataDome protection. ### Code ```swift import DataDomeSDK URLSession .shared .protectedDataTaskPublisher(forURL: url, captchaDelegate: nil) .sink(receiveCompletion: { completion in switch completion { case .finished: break case .failure(let error): print(error.localizedDescription) } }, receiveValue: { response in guard let httpResponse = response.response as? HTTPURLResponse else { print("Invalid response") return } print("Did receive response with code \(httpResponse.statusCode)") } }) ``` ``` -------------------------------- ### Install Node.js Module Source: https://docs.datadome.co/docs/module-nodejs Install the DataDome Node.js module using npm. ```shell npm i @datadome/node-module ``` -------------------------------- ### Initialize New Fastly Compute Service with DataDome Template Source: https://docs.datadome.co/docs/fastly-compute Use this command to set up a new Fastly Compute service project from the DataDome public template. Ensure Fastly CLI and Node.js 18+ are installed. ```bash fastly compute init --from=https://github.com/DataDome/datadome-fastly-compute-template \ --language=javascript \ --accept-defaults \ -y ``` -------------------------------- ### Install DataDome Next.js Module Source: https://docs.datadome.co/docs/nextjs Install the DataDome module for Next.js using npm. ```shell npm install @datadome/module-nextjs ``` -------------------------------- ### Python: Register User with DataDome SDK Source: https://docs.datadome.co/docs/account-protect-registration This Python example shows how to integrate the DataDome SDK for user registration validation. It includes setting up user, address, and session details before sending the registration event. ```python from datadome_fraud_sdk_python import DataDome, ResponseAction, RegistrationEvent, UserSession, Address, Title, User as datadomeUser datadome_instance = DataDome("FraudAPIKey") def signup(): account = request.form.get('email') datadomeUserSession = UserSession(session.id) userAddress = Address(name="Home",line1="123 Maple Street", line2="2nd floor", city="Anytown", countrycode="FR", country="France", regioncode="PA",zipcode="17101") user = datadomeUser(id=account, title=Title.MR, firstname="John",lastname="Doe", createdAt=datetime.now(), phone="+33978787878", email=account, address=userAddress) registrationEvent = RegistrationEvent(account, user, datadomeUserSession) datadome_response = await datadome_instance.validate(request, registrationEvent) if datadome_response.action == ResponseAction.ALLOW: flash("You are allowed to register!") db.register(user) # register user in your system return redirect(url_for('auth.signup')) else: flash("You are not allowed to register, reason:" + str(datadome_response.reasons[0])) return redirect(url_for('auth.login')) ``` -------------------------------- ### Java Example for Login Event with DataDome SDK Source: https://docs.datadome.co/docs/account-protect-login This Java example demonstrates integrating the DataDome Fraud SDK for login events. It covers SDK initialization, creating LoginEvent objects with user and authentication details, and using the `validate` or `collect` methods based on the authentication outcome. ```java // 1. Add your FRAUD_API_KEY as an application configuration parameter // example for resource file "application.properties" datadome.fraud.api_key=FRAUD_API_KEY // 2. In an application component add the DataDome Fraud SDK import co.datadome.fraud.DataDomeFraudService; // LoginEvent related objects import co.datadome.fraud.api.request.event.LoginEvent; import co.datadome.fraud.model.User; import co.datadome.fraud.model.Session; import co.datadome.fraud.model.authentication.*; // 3. Initialize the DataDome Fraud SDK in a Spring bean @Bean public DataDomeFraudService dataDomeFraud( @Value("${datadome.fraud.api_key}") String datadomeFraudApiKey) { return new DataDomeFraudService(datadomeFraudApiKey); } // 4. Use dependency injection to use in it in the controller (here in the constructor) public LoginController(DataDomeFraudService dataDomeFraudService) { this.dataDomeFraudService = dataDomeFraudService; } // 5. Use it in the login endpoint of login controller public ResponseEntity login(ServletRequest request, User user) { if (this.authenticateUser(user)) { LoginEvent loginEvent = LoginEvent.newBuilder() .user(co.datadome.fraud.model.User.newBuilder().id("user_id").build()) .account(userform.user.get("email")) .authentication(Authentication.newBuilder() .type(AuthenticationType.SOCIAL) .socialProvider(SocialProvider.GOOGLE) .mode(AuthenticationMode.PASSWORD) .build()) .session(Session.newBuilder() .id("session_id") .build()) .build(); DataDomeResponse validate = this.dataDomeFraudService .validate(request, loginEvent); if (validate.getAction() == ResponseActionType.allow) { return new ResponseEntity<>("Welcome", HttpStatus.OK); } else { // Business Logic here // MFA // Challenge // Notification email // temporarly lock account return new ResponseEntity<>(validate, HttpStatus.UNAUTHORIZED); } else { DataDomeResponse collect = this.dataDomeFraudService .collect(request, new LoginEvent(user.getLogin())); Message response = new Message("error", "invalid credentials"); return new ResponseEntity<>(response, HttpStatus.UNAUTHORIZED); } [...] } ``` ``` -------------------------------- ### Perform Magento Setup and Cache Cleaning Source: https://docs.datadome.co/docs/magento-with-fastly-cdn After upgrading the module, run these commands to apply changes, deploy static content, and clean the cache. ```shell bin/magento setup:upgrade --keep-generated ``` ```shell bin/magento setup:static-content:deploy ``` ```shell bin/magento cache:clean ``` -------------------------------- ### Initialize DataDome Client with Functional Options (v2) Source: https://docs.datadome.co/docs/go-migration-guide-from-v1-to-v2 Use functional options to configure the DataDome client in v2. This example demonstrates setting the endpoint, timeout, GraphQL support, referrer restoration, URL pattern exclusion, URL pattern inclusion, and a custom logger. ```go client, err := dd.NewClient( "Some key", dd.WithEndpoint("api.datadome.co"), dd.WithTimeout(150), dd.WithGraphQLSupport(true), dd.WithReferrerRestoration(true), dd.WithUrlPatternExclusion(`(?i)\.(avi|flv|mka|mkv|mov|mp4|mpeg|mpg|mp3|flac|ogg|ogm|opus|wav|webm|webp|bmp|gif|ico|jpeg|jpg|png|svg|svgz|swf|eot|otf|ttf|woff|woff2|css|less|js|map|json)$`), dd.WithUrlPatternInclusion(`(?i)\/included\/endpoint`), dd.Logger(dd.NewDefaultLogger()), ) ``` -------------------------------- ### Install SUSE Dependencies Source: https://docs.datadome.co/docs/apache Installs necessary packages for compiling the DataDome module on SUSE systems. ```shell zypper install make openssl-devel apache2-devel ``` -------------------------------- ### Instantiate Scala SDK with Options Source: https://docs.datadome.co/docs/account-protect-custom-events Build a Scala SDK instance for fraud services, configuring the endpoint and timeout. ```scala val dataDomeFraudService = new DataDomeFraudService(datadomeFraudApiKey, DataDomeOptions.newBuilder() .endpoint("https://account-api.datadome.co") .timeout(1500) .build() ) ``` -------------------------------- ### Install DataDome Express Module v2 Source: https://docs.datadome.co/docs/migration-guide-from-v1-to-v2 Install the new package for integrating DataDome with the Express framework. ```shell npm install @datadome/module-express ``` -------------------------------- ### Install datadome-asgi with pip Source: https://docs.datadome.co/docs/fastmcp Install the DataDome ASGI module using pip. Ensure your pip is up-to-date. ```shell pip install datadome-asgi ``` -------------------------------- ### Instantiate DataDome Client (v2) Source: https://docs.datadome.co/docs/go-migration-guide-from-v1-to-v2 Instantiate the DataDome client using the new `NewClient` function with your server-side key. Handles configuration errors during instantiation. ```go dd "github.com/datadome/module-go-package/v2" func main() { client, err := dd.NewClient("DATADOME_SERVER_SIDE_KEY") if err != nil { // Error may be returned in case of misconfiguration } } ``` -------------------------------- ### C# Example for Login Event Source: https://docs.datadome.co/docs/account-protect-login This C# example shows how to create and send a login event to DataDome. It includes setting account creation date and handling potential errors by redirecting the user. ```csharp } AccountCreationDate = DateTime.UtcNow } ); } TempData["ErrorMessage"] = "Error in login, please input your details again."; TempData["From"] = "login"; return RedirectToAction("Index"); } ``` ``` -------------------------------- ### Install DataDome module with npm Source: https://docs.datadome.co/docs/cloudflare-worker-npm Run this command in your Worker project directory to install the DataDome module. ```shell npm install @datadome/module-cloudflare-worker ``` ```shell yarn add @datadome/module-cloudflare-worker ``` -------------------------------- ### Install RHEL/CentOS Dependencies Source: https://docs.datadome.co/docs/apache Installs necessary packages for compiling the DataDome module on RHEL or CentOS systems. ```shell yum install make openssl-devel httpd-devel which gcc mod_ssl ``` -------------------------------- ### Install Debian/Ubuntu Dependencies Source: https://docs.datadome.co/docs/apache Installs necessary packages for compiling the DataDome module on Debian or Ubuntu systems. ```shell apt-get install make libssl-dev apache2-dev ```