
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-native-p2pkit
Advanced tools
p2pkit is an easy to use SDK that bundles together several proximity technologies kung-fu style! With p2pkit apps immediately understand their proximity to nearby devices and users, estimate their range and broadcast information to them.
Using p2pkit requires an application key, start by creating a p2pkit account here: Create p2pkit account
Once you have an account you can log-in to the console and create an application key: Create your Application Key. p2pkit validates Bundle/Application ID so don't forget to add your.package.name to the known Bundle/Application ID when creating your application key
Add the module to your project
react-native install react-native-p2pkit --save
react-native link react-native-p2pkit
Currently the module is configured to use CocoaPods for fetching and linking the P2PKit.framework. If you are getting "header search paths" errors, make sure to compile the Pods project at least once so that the p2pkit headers will be exported to ./Pods/Headers/Public, the module is configured to search for them there. Note that Bitcode is not supported, you would need to disable Bitcode in your iOS project.
Here is an example that implements p2pkit functionality. Begin by calling startP2PKit():
import p2pkit from 'react-native-p2pkit';
var p2pkitCallback = {
onException: function(exceptionMessage) {
console.log(exceptionMessage.message)
},
onEnabled: function() {
console.log('p2pkit is enabled')
p2pkit.enableProximityRanging()
p2pkit.startDiscovery('') //base64 encoded Data (bytes)
},
onDisabled: function() {
console.log('p2pkit is disabled')
},
// Refer to platform specific API for error codes
onError: function(errorObject) {
console.log('p2pkit failed to enable on platform ' + errorObject.platform + ' with error code ' + errorObject.errorCode)
},
onDiscoveryStateChanged: function(discoveryStateObject) {
console.log('discovery state updated on platform ' + discoveryStateObject.platform + ' with error code ' + discoveryStateObject.state)
},
onPeerDiscovered: function(peer) {
console.log('peer discovered ' + peer.peerID)
},
onPeerLost: function(peer) {
console.log('peer lost ' + peer.peerID)
},
onPeerUpdatedDiscoveryInfo: function(peer) {
console.log('discovery info updated for peer ' + peer.peerID + ' info ' + peer.discoveryInfo)
},
onProximityStrengthChanged: function(peer) {
console.log('proximity strength changed for peer ' + peer.peerID + ' proximity strength ' + peer.proximityStrength)
},
onGetMyPeerId: function(reply) {
console.log(reply.myPeerId)
}
}
startP2PKit: function() {
p2pkit.enable('<YOUR APPLICATION KEY>', p2pkitCallback)
}
The full API for the module is available at index.js.
In general, a tutorial as well as more documentation for p2pkit is available on our website at: http://p2pkit.io/developer
FAQs
p2pkit is a proximity framework for iOS and Android
We found that react-native-p2pkit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.