Skip to main content

Overview

This example demonstrates how to use Hermis with vanilla JavaScript - no framework required! The guide shows examples for both web3.js (legacy) and @solana/kit (modern) architectures.

Architecture Guide

Web3.js (Legacy)

  • Mature and widely supported
  • Compatible with all existing Solana tools
  • Well-documented ecosystem
  • Larger bundle size

@solana/kit (Modern)

  • Type-safe instruction building
  • Better tree-shaking for smaller bundles
  • Modern API design
  • Future-proof architecture
Good news: Both architectures work seamlessly with WalletAdapterManager! You can even use Kit signers with wallet adapters through createKitSignersFromAdapter.

Project Setup

HTML Structure

index.html

Styling

style.css

Wallet Connection

Send Transaction

HTML for transaction UI:

Sign Message

HTML for message signing:

Build Setup

package.json

Running the Example

Open http://localhost:5173 in your browser!

Features Demonstrated

Web3.js Architecture

Wallet connection with WalletAdapterManager
SOL balance fetching
Transaction sending (SOL transfers)
Message signing
Event-driven wallet state
Error handling

Kit Architecture

Kit signer creation from adapters
Kit transaction building with pipe pattern
Kit message signing with signBytes
Type-safe instruction building
Functional composition with pipe
Modern RPC interface

Both Architectures

Same WalletAdapterManager for connection
Seamless bridge via createKitSignersFromAdapter
Multi-wallet support
Event-driven architecture