Embed & Integrate
The Silk SDK is designed for ease of use by both seasoned Web3 devs and those new to self-custody wallets and cryptography.
1. Install
2. Use
Just getting started with Web3 development? You can easily embed Silk to your site following standard practices that minimizes bugs or performance issues. Silk exposes an EIP-1193-compliant interface, so you can use it just as you would use MetaMask, one of the most common Web3 wallet services. The only difference is that Silk must be initialized.
The following code initializes Silk, presents the login modal to the user, and gets the user's wallet addresses.
If you want to customize this login flow with additional wallet options for web3-native users, you may choose to use the loginSelector
method instead of the login
method. This will let you set the options if a user chooses to sign in with a web3 wallet instead. See the Methods section for more details on how to do so.
Once users have logged in, you can use Silk as a Provider object with libraries such as viem, ethers, wagmi, or any other that supports EIP-1193 Providers. Simply pass the silk
object as the provider and you are good to go.
3. Examples
Silk + Next.js + Viem
Check out the repo for https://silk-template.vercel.app/
Last updated