Getting Started
Already have support for Web3? GREAT 🎉, this is the place to start.
If you already support Web3-technology, you can improve the UX within your application by integrating the Venly Web3 provider, a smart wrapper around the existing Web3 Ethereum JavaScript API.
By making use of our Web3 provider you are able to leverage the full potential of Venly with minimal effort and you will be able to onboard users that are less tech-savvy without making them leave your application or download third-party plugins. Integrating just takes 2 steps and 5 minutes.
Install the library by downloading it to your project via NPM
npm i @venly/web3-provider
followed by adding the script to the head of your page.
<script src="/node_modules/@venly/web3-provider/dist/web3-provider.js"></script>
After adding the javascript file to your page, a global Venly object is added to your window. This object is the gateway for creating the web3 wrapper and fully integrates the widget - Venly Connect.
<script src="https://cdnjs.cloudflare.com/ajax/libs/venly-web3-provider/<REPLACE_WITH_LATEST_VERSION>/web3-provider.min.js" integrity="sha512-862609WyjtbVCooM7kzMuiZRZiXxtJbCzONHkA7sJrbJ2d5jL37giM8i86hoaccxBxh24M6VqICiGEoNsGZ5Qw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
Add the following lines of code to your project, it will load the Venly web3 provider.
Simple
Advanced
Venly.createProviderEngine({clientId: 'Testaccount'}).then(provider => {
web3 = new Web3(provider);
});
const options = {
clientId: 'Arketype',
environment: 'staging', //optional, production by default
signMethod: 'POPUP', //optional, REDIRECT by default
bearerTokenProvider: () => 'obtained_bearer_token', //optional, default undefined
//optional: you can set an identity provider to be used when authenticating
authenticationOptions: {
idpHint: 'google'
},
secretType: 'ETHEREUM' //optional, ETHEREUM by default
};
Venly.createProviderEngine(options).then(provider => {
web3 = new Web3(provider);
});
The web3 instance now works as if it was injected by parity or metamask. You can fetch wallets, sign transactions, and messages.
Last modified 1mo ago