Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@adobe/react-native-aepedge
Advanced tools
Adobe Experience Platform Edge Network extension for Adobe Experience Platform Mobile SDK. Written and maintained by Adobe.
@adobe/react-native-aepedge
is a wrapper around the iOS and Android Adobe Experience Platform Edge Network to allow for integration with React Native applications.
The Edge Network extension has the following peer dependencies, which must be installed prior to installing the Edge extension:
See Requirements and Installation instructions on the main page
Install the @adobe/react-native-aepedge
package:
cd MyReactApp
npm install @adobe/react-native-aepedge
Install the Adobe Experience Platform Edge Network extension in your mobile property and configure the default Datastream ID by following the steps in the Edge Network extension documentation.
Then follow the same document for registering the Edge extension with the Mobile Core. Note that initializing the SDK should be done in native code, additional documentation on how to initialize the SDK can be found here.
Initialization Example
iOS
// AppDelegate.h
@import AEPCore;
@import AEPEdge;
@import AEPEdgeIdentity;
...
@implementation AppDelegate
// AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// TODO: Set up the preferred Environment File ID from your mobile property configured in Data Collection UI
NSString* ENVIRONMENT_FILE_ID = @"YOUR-APP-ID";
NSArray *extensionsToRegister = @[AEPMobileEdgeIdentity.class,
AEPMobileEdge.class
];
[AEPMobileCore registerExtensions:extensionsToRegister completion:^{
[AEPMobileCore configureWithAppId: ENVIRONMENT_FILE_ID];
...
}];
return YES;
}
@end
Android
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.Edge;
import com.adobe.marketing.mobile.edge.identity.Identity;
...
import android.app.Application;
...
public class MainApplication extends Application implements ReactApplication {
...
// TODO: Set up the preferred Environment File ID from your mobile property configured in Data Collection UI
private final String ENVIRONMENT_FILE_ID = "YOUR-APP-ID";
@Override
public void on Create(){
super.onCreate();
...
MobileCore.setApplication(this);
MobileCore.configureWithAppID(ENVIRONMENT_FILE_ID);
MobileCore.registerExtensions(
Arrays.asList(Identity.EXTENSION, Edge.EXTENSION),
o -> Log.d("MainApp", "Adobe Experience Platform Mobile SDK was initialized")
);
}
}
In your React Native application, import the Edge extension as follows:
import {Edge, ExperienceEvent} from '@adobe/react-native-aepedge';
Returns the version of the client-side Edge extension.
Syntax
extensionVersion(): Promise<string>
Example
Edge.extensionVersion().then(version => console.log("AdobeExperienceSDK: Edge version: " + version));
Gets the Edge Network location hint used in requests to the Adobe Experience Platform Edge Network. The Edge Network location hint may be used when building the URL for Adobe Experience Platform Edge Network requests to hint at the server cluster to use.
Syntax
getLocationHint(): Promise<string|null>
Example
Edge.getLocationHint().then(hint =>
console.log('AdobeExperienceSDK: location hint = ' + hint),
);
Sets the Edge Network location hint used in requests to the Adobe Experience Platform Edge Network. Passing null or an empty string clears the existing location hint. Edge Network responses may overwrite the location hint to a new value when necessary to manage network traffic.
Warning: Use caution when setting the location hint. Only use location hints for the "EdgeNetwork" scope. An incorrect location hint value will cause all Edge Network requests to fail with 404 response code.
Syntax
setLocationHint(hint?: string)
Example
Edge.setLocationHint('va6');
Resets current state of the AEP Edge extension and clears previously cached content related to current identity, if any. See MobileCore.resetIdentities for more details.
Sends an Experience event to Edge Network.
Starting with @adobe/react-native-aepedge v5.1.0, the sendEvent API supports optional Datastream overrides. This allows you to adjust your datastreams without the need for new ones or modifications to existing settings. The process involves two steps:
Note: You can find a tutorial for Datastream config overrides using rules here.
Syntax
sendEvent(experienceEvent: ExperienceEvent): Promise<Array<EdgeEventHandle>>
Example
const sampleXdmData = {"eventType" : "SampleXDMEvent"};
const freeFormData = {"free": "form", "data": "example"};
let experienceEvent = new ExperienceEvent({xdmData: sampleXdmData , data: freeFormData});
// send ExperienceEvent ignoring the promise
Edge.sendEvent(experienceEvent);
// send ExperienceEvent with promise
Edge.sendEvent(experienceEvent).then(eventHandles => console.log("Edge.sentEvent returned EdgeEventHandles = " + JSON.stringify(eventHandles)));
Example with Datastream ID override
const sampleXdmData = {"eventType" : "SampleXDMEvent"};
let experienceEvent = new ExperienceEvent({xdmData: sampleXdmData, datastreamIdOverride: 'SampleDataStreamId'});
// send ExperienceEvent ignoring the promise
Edge.sendEvent(experienceEvent);
Example with Datastream config override
const sampleXdmData = { eventType: 'SampleXDMEvent' };
const configOverrides = {
com_adobe_experience_platform: {
datasets: {
event: {
datasetId: 'SampleEventDatasetIdOverride',
},
},
},
com_adobe_analytics: {
reportSuites: ['sampleRSID'],
}
};
let experienceEvent = new ExperienceEvent({xdmData: sampleXdmData, datastreamConfigOverride: configOverrides});
// send ExperienceEvent ignoring the promise
Edge.sendEvent(experienceEvent);
The EdgeEventHandle is a response fragment from Adobe Experience Platform Edge Network for a sent XDM Experience Event. One event can receive none, one or multiple EdgeEventHandle(s) as response.
class EdgeEventHandle {
type?: string;
payload?: Array<Record<string, any>>;
constructor(type?: string, payload?: Array<Record<string, any>>) {
this.type = type;
this.payload = payload;
}
}
export default EdgeEventHandle;
Experience Event is the event to be sent to Adobe Experience Platform Edge Network. The XDM data is required for any Experience Event being sent using the Edge extension.
Usage
//Experience Event setting with objects, recommended way to create experience event
ExperienceEvent({xdmData: xdmData, data: data, datasetIdentifier: datasetIdentifier});
ExperienceEvent({xdmData: xdmData, data: data, datastreamIdOverride: datastreamIdOverride});
ExperienceEvent({xdmData: xdmData, data: data, datastreamConfigOverride: datastreamConfigOverride});
//Experience Event setting with parameters, previously supported
ExperienceEvent(xdmData, data, datasetIdentifier);
Example
//Example 1
// set free form data to the Experience event
const sampleXdmData = {"eventType" : "SampleXDMEvent"};
const freeFormData = {"free": "form", "data": "example"};
let experienceEvent = new ExperienceEvent({xdmData: sampleXdmData, data: freeFormData});
//Example 2
// Set free form data and datastream id override to the current Experience event:
const sampleXdmData = { eventType: 'SampleXDMEvent' };
const freeFormData = {"free": "form", "data": "example"};
let experienceEvent = new ExperienceEvent({xdmData: sampleXdmData, data: freeFormData, datastreamIdOverride: 'SampleDataStreamId'});
//Example 3
// Set datastream config override to the current Experience event:
const sampleXdmData = { eventType: 'SampleXDMEvent' };
const configOverrides = {
com_adobe_experience_platform: {
datasets: {
event: {
datasetId: 'SampleEventDatasetIdOverride',
},
},
},
com_adobe_analytics: {
reportSuites: ['sampleRSID'],
}
};
let experienceEvent = new ExperienceEvent({xdmData: sampleXdmData, datastreamConfigOverride: configOverrides});
For examples on XDM schemas and datasets setup and tips on validating with Assurance, refer to the Edge Network tutorial.
FAQs
Adobe Experience Platform Edge Network extension for Adobe Experience Platform Mobile SDK. Written and maintained by Adobe.
We found that @adobe/react-native-aepedge demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 24 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.