This directory contains standalone example applications demonstrating how to use @tenprotocol/ten-kit in different scenarios.
The simplest possible example - connect a wallet and display the connected address.
What it demonstrates:
- Setting up TEN Kit with wagmi
- Using the
ConnectWalletButtoncomponent - Reading wallet connection state
- Basic styling with Tailwind CSS
Run it:
cd basic-app
npm install
npm run devAll examples use the local TEN Kit package (not from npm) via the file:../.. dependency. This allows you to:
- Test changes to the TEN Kit library immediately
- Debug the library in a real application context
- Develop new features with live feedback
For any example:
-
Build the TEN Kit library first (from the root directory):
cd /Users/pete/projects/TENConnect npm run build -
Navigate to the example:
cd examples/basic-app -
Install dependencies:
npm install
-
Run the example:
npm run dev
When making changes to the TEN Kit library:
- Make your changes in the main library (
src/directory) - Rebuild the library:
npm run build(from root) - The example will automatically use the updated library
- Refresh your browser to see the changes
Tip: You can use npm run dev in the root directory to watch for changes and rebuild automatically.
- Node.js 18+
- npm or yarn
- A Web3 wallet (MetaMask, Rabby, etc.)
- Connection to TEN Protocol network
When adding new examples:
- Create a new directory in
examples/ - Set up as a standalone project
- Use
"@tenprotocol/ten-kit": "file:../.."in package.json - Include a comprehensive README.md
- Update this main README with a link to your example
Solution: Build the main library first:
cd /Users/pete/projects/TENConnect
npm run buildSolution: Rebuild the library and refresh your browser:
npm run build # from rootSolution: Delete node_modules and reinstall:
rm -rf node_modules package-lock.json
npm install