Install the Monetate SDKs
this documentation guides you through setting up and implementing the react web, react native, ios, and android versions of the monetate sdk react web prerequisites you must have node and yarn installed to set up this sdk refer to the installation instructions for https //nodejs org/en/download/package manager and https //classic yarnpkg com/en/docs/install#windows stable for more information installing and importing packages the react web version of the monetate sdk consists of these packages web for applications written in react javascript common methods and constants shared between the react native and web packages to install the sdk packages, first set the default artifactory npm registry using the following command command to set the default artifactory npm registry npm config set registry https //monetate jfrog io/artifactory/api/npm/monetate npm local next, install the desired sdk packages with each of the following codes command to install the web sdk package npm install @personalization js sdk/web command to install the common sdk package npm install @personalization js sdk/common if you encounter a peer dependencies error during installation, add the line legacy peer deps to the installation command getting started use the following code to initialize an object to communicate with the engine api code to initialize an object to communicate with engine api const sdkinstace = new personalization(account, user); react native prerequisites you must have node and yarn installed to set up this sdk refer to the installation instructions for https //nodejs org/en/download/package manager and https //classic yarnpkg com/en/docs/install#windows stable for more information installing and importing packages the react native version of the monetate sdk consists of these packages react native for applications written using the react native framework common methods and constants shared between the react native and web packages to install the sdk packages, first set the default artifactory npm registry using the following command command to set the default artifactory npm registry npm config set registry https //monetate jfrog io/artifactory/api/npm/monetate npm local next, install the desired sdk packages with each of the following codes command to install the react native sdk package npm install @personalization js sdk/react native command to install the common sdk package npm install @personalization js sdk/common if you encounter a peer dependencies error during installation, add the line legacy peer deps to the installation command getting started use the following code to initialize an object to communicate with the engine api code to initialize an object to communicate with engine api const sdkinstace = new personalization(account, user); ios monetate ios sdk integration swift package manager (spm) overview this document provides step by step instructions for integrating the monetate personalization ios sdk using swift package manager (spm) swift package manager is the recommended dependency management approach for modern ios applications environment requirements before proceeding, ensure your environment meets the following requirements xcode 14 0 or later (latest stable version recommended) ios deployment target ios 13 0+ swift version 5 7+ monetate account active monetate account credentials project requirements your application must meet the following conditions project supports swift package manager outbound https requests are allowed network permissions are enabled app transport security (ats) configured if required the main branch can be used by default however, if production control or version stability is required, a specific version or tagged release should be used installation method 1 — using xcode (recommended) open your project in xcode navigate to file → add package dependencies … enter the monetate repository url https //github com/monetate/monetate personalization ios sdk git choose main branch or a specific tagged version select your app target click add package verify installation go to project → package dependencies you should see the monetate sdk listed method 2 — manual spm configuration (package swift) if your project manages dependencies manually 1 add dependency add the monetate sdk to your package swift file ios dependencies \[ package( url "https //github com/monetate/monetate personalization ios sdk git", branch "main" ) ] add the monetate sdk to your target ios target( name "yourapp", dependencies \[ product(name "monetate", package "monetate personalization ios sdk") ] ) import the sdk where needed ios import monetate note use the main branch by default, or specify a tagged version if production version control is required build the project to resolve and fetch dependencies usage after successful installation import the sdk module in your swift files initialize the sdk using your monetate account credentials confirm successful initialization before triggering personalization calls (refer to the initialization guide for detailed setup instructions ) troubleshooting if you encounter build or installation issues basic steps clean build folder shift + cmd + k delete derived data ensure package is added to the correct target confirm product dependency is properly linked advanced steps remove and re add the package reset package cache file → packages → reset package caches restart xcode after dependency resolution cocoapods prerequisites you must have cocoapods installed to set up this sdk refer to https //guides cocoapods org/using/getting started html#getting started in the https //guides cocoapods org/using/getting started html for more information installing the sdk complete the following steps to integrate the sdk within your app first, open the podfile and add the following code code to begin installing monetate sdk target 'monetate' do \# comment the next line if you do not want to use dynamic frameworks use frameworks! pod 'monetate ios sdk' \# pods for monetate post install do |installer| installer generated projects each do |project| 	 project targets each do |target| 	 target build configurations each do |config| 	 config build settings\['iphoneos deployment target'] = '13 0' 	 end 	 end 	end end end next, go to the root path of your project in the terminal and run pod install after installation, the sdk appears in the pods directory in your project sidebar callout of the monetate ios sdk folder in the location of the sdk in the pods directory getting started use the following code to initialize an object to communicate with the engine api code to initialize an object to communicate with engine api final var objpersonalization = personalization(account account(instance "p", domain "localhost org", name "a 701b337c", shortname "localhost"), user user(monetateid "2 1454546575 1711006580023", deviceid "62bd2e2d 213d 463f 83bb 12c0b2530a14", customerid "12345")) android prerequisites you must have android studio installed to set up this sdk refer to the https //developer android com/studio site for more information integrating the sdk into a project complete the following steps to integrate the sdk within your app first, download the https //monetate jfrog io/ui/native/monetate android local/com/monetate/personalization/androidsdk/monetate personalization android sdk , ensuring that you download the latest version, and then open your app project and switch to project view project view in android studio, with a callout of the project selector next, copy and paste the sdk into the app > libs directory callout of the libs directory in android studio open the build gradle(\ app) file and include the following code under the dependencies section dependencies code implementation filetree(include \[' jar'], dir 'libs')callout of the implementation filetree(include \[' jar'], dir 'libs') line of code in android studio finally, click sync now in the notification that appears prompting you to perform a project sync getting started use the following code to initialize an object to communicate with the engine api code to initialize an object to communicate with engine api sdkinstace = new personalization(account, user);