Test of concept integration of Cardano wallet and a website. Based on NodeJs and Webpack 5. There are several things to consider in this project, so consider this as a reference, but a useful project for community.
The frontend is built using webpack, cardano serialisation library and integrates with Nami Wallet using the exposed api with the browser extension. Check Nami github for reference or the discord channel.
The NodeJS backend calls twitter and blockfrost using Axios, can be responsible for a simple authentication mechanism validating some users we allow and redirecting responses.
No user information is stored in any database whatsoever, all privacy information is only stored in local machine and lost after browser is closed.
First, you will need:
- Install node, npm install.
- Have a Twitter developer account if you want to integrate with Twitter authentication server.
Not much needed for development. Just run npm run dev
You have to create a file named .env containing the following variables: NODE_ENV=development IPFS=your ipfs blockfrost api key BLOCKFROST_KEY=your blockfrost mainnet or testnet api
BLOCKFROST=https://cardano-testnet.blockfrost.io BEARER=twitter bearer key, obtained on twitter developer portal API_KEY=twitter developer api key API_SECRET=twitter developer api secret
For start the backend in development, run npm start
Sometimes Twitter will update their API, we only have to do is going to https://www.srihash.org/ paste the url to twitter api https://platform.twitter.com/widgets.js and update the index.html!