@pushprotocol/react-native-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Push Protocol is a web3 communication network, enabling cross-chain notifications, messaging, video, and NFT chat for dapps, wallets, and services.🚀

Index

Push React Native SDK

Push SDK provides an abstraction layer to integrate Push protocol features with your Frontend as well as Backend. This SDK is a react-native based repo of packages that helps developers to :

  • Build PUSH features into their DApps
    • Notifications
    • Chat
    • Group Chat

without having to write a lot of boilerplate code. All the heavy lifting is done by the SDK, so that you the developer can focus on building features and bootstrap a DApp with PUSH features in no time!

How to use in your app?

Install the SDK

yarn add @pushprotocol/react-native-sdk

or

npm install @pushprotocol/react-native-sdk

Install the peer dependencies

yarn add react-native-randombytes@3.6.1 react-native-webview@13.2.2 react-native-webview-crypto@0.0.25

or

npm install react-native-randombytes@3.6.1 react-native-webview@13.2.2 react-native-webview-crypto@0.0.25

Nodeify the crypto packages

Add postinstall script in your package.json file if node_modules are not nodeified already

"postinstall": "node_modules/.bin/rn-nodeify --install crypto,assert,url,stream,events,http,https,os,url,net,fs --hack"

Add the WebViewCrypto component in your app root

import WebViewCrypto from 'react-native-webview-crypto';

return (
  <>
    <WebViewCrypto />
    <App />
  </>
);

Start using the Push SDK in your app

For the complete list of features and how to use them, please refer to the restapi documentation.

import { PushAPI, CONSTANTS } from '@pushprotocol/react-native-sdk';
import { ethers } from 'ethers';

const signer = new ethers.Wallet(
  '07da77f7471e5cf046ea3793421cbce90fd42a4cfcf520046a490ca1a9b636e0'
);
const account = `eip155:${signer.address}`;

const alice = await PushAPI.initialize(signer, {
  account,
  env: CONSTANTS.ENV.DEV,
});

const spam = await alice.notification.list('SPAM', {
  limit: 10,
  page: 1,
});

console.log('SPAM NOTIFICATIONS', spam);

Resources

  • Website To checkout our Product.
  • Docs For comprehensive documentation.
  • Blog To learn more about our partners, new launches, etc.
  • Discord for support and discussions with the community and the team.
  • GitHub for source code, project board, issues, and pull requests.
  • Twitter for the latest updates on the product and published blogs.

Contributing

Push Protocol is an open source Project. We firmly believe in a completely transparent development process and value any contributions. We would love to have you as a member of the community, whether you are assisting us in bug fixes, suggesting new features, enhancing our documentation, or simply spreading the word.

  • Bug Report: Please create a bug report if you encounter any errors or problems while utilising the Push Protocol.
  • Feature Request: Please submit a feature request if you have an idea or discover a capability that would make development simpler and more reliable.
  • Documentation Request: If you're reading the Push documentation and believe that we're missing something, please create a docs request.

Read how you can contribute HERE

Not sure where to start? Join our discord and we will help you get started!

Discord

License

Check out our License HERE

Package Sidebar

Install

npm i @pushprotocol/react-native-sdk

Weekly Downloads

5

Version

1.1.1

License

MIT

Unpacked Size

37.7 kB

Total Files

21

Last publish

Collaborators

  • pushprotocol