Quickstart
Version 1 is DEPRECATED and won't be mantained. Please migrate to Version 2.
1) Install package
# Install dependencies
```bash
yarn add \
@emotion/styled@^11.14.0 \
@emotion/react@^11.14.0 \
framer-motion@^11.14.0 \
@tanstack/react-query@^5.64.2 \
@chakra-ui/react@^2.8.2 \
@vechain/[email protected] \
@vechain/[email protected] \
@vechain/[email protected]
```
# Install vechain kit
```bash
yarn @vechain/[email protected]
```Only supported on React and Next.js
React query, chakra and dapp-kit are peer dependencies.
2) Define Provider
On Next.js you will need to dynamically load the import
Login Methods
The modal implements a dynamic grid layout system that can be customized through the loginMethods configuration.
The modal can be configured through the VeChainKitProvider props.
Login methods selection:
vechain, dappkit, and ecosystem are always available options
The Privy-dependent methods (email, google, passkey, more) are only available when the privy prop is defined
TypeScript will show an error if someone tries to use a Privy-dependent method when privy is not configured
3) Setup Fee Delegation (mandatory if allowing social login)
Fee delegation is mandatory if you want to use this kit with social login. Learn how to setup fee delegation in the following guide:
Fee Delegation4) Setup Privy (optional)
If you have your own Privy app, you can pass an additional prop with your settings.
Go to privy.io and create an app. You will find the APP ID and the CLIENT ID in the App Settings tab.
For further information on how to implement Privy SDK please refer to their docs: https://docs.privy.io/
This project uses:
@privy-io/react-auth for Privy connection type
@privy-io/cross-app-connect for ecosystem cross app connection
You can import privy from the kit as
If you setup your own Privy be sure to go over the recommended security settings provided by Privy: https://docs.privy.io/guide/security/implementation/ and https://docs.privy.io/guide/security/implementation/csp
5) Setup Legal Documents (optional)
To prompt users to review and accept your policies, like Terms and Conditions, Privacy Policy, or Cookie Policy, VeChainKit offers a simple plug-and-play solution.
You can avoid building your own if you haven't already.
By enabling also the tracking consent, you will allow VeChainKit to prompt your users to collect data to improve the kit.
When the legalDocuments option is configured, the users will see:
Left: A modal prompt when connecting their wallet, requiring them to review and accept required and optional legal documents.
Right: A summary view under
Settings > General > Terms and Policies, showing which policies theyβve accepted and when.


Key Options
allowAnalytics
boolean
No
If true, prompts users with an optional tracking policy.
cookiePolicy
array
No
One or more cookie policy versions.
privacyPolicy
array
No
One or more privacy policy versions.
termsAndConditions
array
No
One or more T&C versions.
6) Show the login button
Once you set up the kit provider, you are good to go, and you can allow your users to login, customizing the login experience based on your needs. You can choose between many options, leaving you complete freedom on your design.
Only available for apps with self hosted Privy .
This is an example of doing login with Google custom button, for more in depth details read here.
You can allow users connect to your app only with wallet by using the dapp-kit connect modal, as follows:
When your app is opened inside VeWorld mobile wallet, VeWorld is always enforced as a login choice.
Support for devs
Are you having issues using the kit? Join our discord server to receive support from our devs or open an issue on our Github!
Check our Troubleshooting section.
Contact us on Discord: https://discord.gg/wGkQnPpRVq
Open an issue on Github: https://github.com/vechain/vechain-kit/issues
Last updated
Was this helpful?