npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-p2pkit

v2.0.0

Published

p2pkit is a proximity framework for iOS and Android

Downloads

30

Readme

p2pkit.io React Native module for iOS & Android

p2pkit is a peer-to-peer proximity SDK for iOS and Android

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.

Get Started

  1. Using p2pkit requires an application key, start by creating a p2pkit account here: Create p2pkit account

  2. 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

  3. Add the module to your project

react-native install react-native-p2pkit --save
react-native link react-native-p2pkit
  1. Setup and link the p2pkit framework on your native environments: iOS: Follow the CocoaPods setup

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.

  1. Once you have configured p2pkit on each platform, you can go ahead and build your react-native app.

Example

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)
}

Documentation

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

p2pkit License

  • By using P2PKit you agree to abide by our Terms of Service, License Agreement and Policies which are available here: http://p2pkit.io/policy.html
  • Please refer to "Third_party_licenses.txt" included with P2PKit.framework for 3rd party software that P2PKit.framework may be using - You will need to abide by their licenses as well