Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@adobe/react-native-aepcore

Package Overview
Dependencies
Maintainers
19
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adobe/react-native-aepcore

Adobe Experience Platform support for React Native apps.

  • 1.0.0-beta.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.9K
increased by15.09%
Maintainers
19
Weekly downloads
 
Created
Source

React Native AEP Core Extension

npm version npm downloads

Usage

Initializing and registering the extension

Initializing the SDK should be done in native code, documentation on how to initialize the SDK can be found here.

Core

Updating the SDK configuration:
MobileCore.updateConfiguration({"yourConfigKey": "yourConfigValue"});
Getting the SDK version:
MobileCore.extensionVersion().then(version => console.log("AdobeExperienceSDK: MobileCore version: " + version));
Getting the log level:
MobileCore.getLogLevel().then(level => console.log("AdobeExperienceSDK: Log Level = " + level));
Controlling the log level of the SDK:
import {LogLevel} from '@adobe/react-native-aepcore';

MobileCore.setLogLevel(LogLevel.VERBOSE);
Using the AEP Logging API:
import {LogLevel} from '@adobe/react-native-aepcore';

MobileCore.log(LogLevel.ERROR, "React Native Tag", "React Native Message");

Note: LogLevel contains the following getters:

const ERROR = "ERROR";
const WARNING = "WARNING";
const DEBUG = "DEBUG";
const VERBOSE = "VERBOSE";
Getting the current privacy status:
MobileCore.getPrivacyStatus().then(status => console.log("AdobeExperienceSDK: Privacy Status = " + status));
Setting the privacy status:
import {PrivacyStatus} from '@adobe/react-native-aepcore';

MobileCore.setPrivacyStatus(PrivacyStatus.OPT_IN);

Note: PrivacyStatus contains the following getters:

const OPT_IN = "OPT_IN";
const OPT_OUT = "OPT_OUT";
const UNKNOWN = "UNKNOWN";
Getting the SDK identities:
MobileCore.getSdkIdentities().then(identities => console.log("AdobeExperienceSDK: Identities = " + identities));
Dispatching an Event Hub event:
import {Event} from '@adobe/react-native-aepcore';

var event = new Event("eventName", "eventType", "eventSource", {"testDataKey": "testDataValue"});
MobileCore.dispatchEvent(event);
Dispatching an Event Hub event with callback:
import {Event} from '@adobe/react-native-aepcore';

var event = new Event("eventName", "eventType", "eventSource", {"testDataKey": "testDataValue"});
MobileCore.dispatchEventWithResponseCallback(event).then(responseEvent => console.log("AdobeExperienceSDK: responseEvent = " + responseEvent));
Collecting PII:
MobileCore.collectPii({"myPii": "data"});
Reset Identities:
MobileCore.resetIdentities();

Identity

Getting the extension version:
Identity.extensionVersion().then(version => console.log("AdobeExperienceSDK: Identity version: " + version));
Sync Identifier:
Identity.syncIdentifier("identifierType", "identifier", MobileVisitorAuthenticationState.AUTHENTICATED);
Sync Identifiers:
Identity.syncIdentifiers({"id1": "identifier1"});
Sync Identifiers with Authentication State:
import {MobileVisitorAuthenticationState} from '@adobe/react-native-aepcore';

Identity.syncIdentifiersWithAuthState({"id1": "identifier1"}, MobileVisitorAuthenticationState.UNKNOWN);

Note: MobileVisitorAuthenticationState contains the following getters:

const AUTHENTICATED = "VISITOR_AUTH_STATE_AUTHENTICATED";
const LOGGED_OUT = "VISITOR_AUTH_STATE_LOGGED_OUT";
const UNKNOWN = "VISITOR_AUTH_STATE_UNKNOWN";
Setting the advertising identifier:
MobileCore.setAdvertisingIdentifier("adID");
Append visitor data to a URL:
Identity.appendVisitorInfoForURL("test.com").then(urlWithVisitorData => console.log("AdobeExperienceSDK: VisitorData = " + urlWithVisitorData));
Get visitor data as URL query parameter string:
Identity.getUrlVariables().then(urlVariables => console.log("AdobeExperienceSDK: UrlVariables = " + urlVariables));
Get Identifiers:
Identity.getIdentifiers().then(identifiers => console.log("AdobeExperienceSDK: Identifiers = " + identifiers));
Get Experience Cloud IDs:
Identity.getExperienceCloudId().then(cloudId => console.log("AdobeExperienceSDK: CloudID = " + cloudId));
Setting the push identifier:
MobileCore.setPushIdentifier("pushIdentifier");
VisitorID Class:
import {VisitorID} from '@adobe/react-native-aepcore';

var visitorId = new VisitorID(idOrigin?: string, idType: string, id?: string, authenticationState?: MobileVisitorAuthenticationState)

Lifecycle

Note: Implementing Lifecycle via Javascript may lead to inaccurate Lifecycle metrics, therefore we recommend implementing Lifecycle in native Android and iOS code.

Getting the extension version:
Lifecycle.extensionVersion().then(version => console.log("AdobeExperienceSDK: Lifecycle version: " + version));

Signal

Getting the extension version:
Signal.extensionVersion().then(version => console.log("AdobeExperienceSDK: Signal version: " + version));

Keywords

FAQs

Package last updated on 20 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc