Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomafrench/onboard-react
https://github.com/tomafrench/onboard-react
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tomafrench/onboard-react
- Owner: TomAFrench
- Created: 2020-02-05T20:20:21.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T01:18:54.000Z (almost 2 years ago)
- Last Synced: 2024-04-25T10:41:04.827Z (8 months ago)
- Language: TypeScript
- Size: 1.07 MB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Onboard-React
JavaScript library providing a wrapper around Blocknative's [Onboard](https://github.com/blocknative/onboard) as a React context to easily store and update user's wallet state.
## Install
`npm install onboard-react`
## Quick Start
```javascript
import OnboardProvider from 'onboard-react'// head to blocknative.com to create a key
const BLOCKNATIVE_KEY = 'blocknative-api-key'// the network id that your dapp runs on
const NETWORK_ID = 1// construct the initialisation object to be given to Onboard
// see: https://docs.blocknative.com/onboard#options
const initialisation = {
dappId: BLOCKNATIVE_KEY,
networkId: NETWORK_ID,
}class App extends Component {
render() {
return (
{....}
)
}
}
```The `OnboardProvider` then gives its children access to (among others) the `useOnboard` hook which returns the `Onboard` object.
## Documentation
For detailed documentation on Onboard head to [docs.blocknative.com](https://docs.blocknative.com/onboard)