Ethers
Learn how to integrate Capsule with Ethers.js for both v5 and v6
Ethers.js is a powerful library for interacting with the Ethereum blockchain. This guide will show you how to integrate Capsule’s signing capabilities with both Ethers v6 and v5, allowing you to securely manage and sign transactions using Capsule’s secure infrastructure.
Prerequisites
Before integrating Capsule with Ethers.js, ensure you have:
- Set up authentication with Capsule. See our Getting Started guides for detailed instructions.
- Configured the Capsule client in your application
- Access to an Ethereum node or RPC provider URL
If you haven’t set up Capsule authentication yet, complete one of our authentication tutorials first and return to this guide when you’re ready to implement signing.
Ethers v6
Installation
Choose your preferred package manager to install the required dependencies:
Usage
First, set up the Capsule Ethers signer:
To sign transactions:
The v6 signer supports all standard signing operations including signMessage()
and signTypedData()
for EIP-712
formatted data.
Ethers v5
Installation
Install the v5-specific integration package:
Usage
Set up the v5 signer:
Server-Side Usage
Capsule can also be used for server-side signing alongside Ethers.js. See our Server-Side Signing Guide for more details on setting up server-side signing with Capsule.