Developers
Integrate LayerCover insurance into your dApp
TL;DR: Add insurance to your dApp in 3 lines with CoverButton, or go headless with the full SDK for complete control.
The @layercover/sdk provides three integration modes - choose the level of control you need:
Integration Modes
Requirements
Prerequisites:
- Node.js โฅ 18
- React โฅ 18 (for React components)
- ethers v6 signer (or viem/wagmi via
ViemAdapter) - @mui/material + @emotion/react + @emotion/styled (for widget UI)
npm install @layercover/sdk ethers @mui/material @emotion/react @emotion/styled
Quick Example
import { CoverButton } from '@layercover/sdk/react'; // That's it - 3 lines to add insurance to your dApp <CoverButton signer={signer} // ethers v6 Signer poolId={1} // Pool ID for your protocol />
Next Steps
โก
Drop-In Widget
3 lines of code. A pre-built button that opens a full purchase modal.
Fastest ๐จModal Component
Control when the modal opens with your own trigger UI. Themeable.
Customisable ๐งHeadless SDK
Full TypeScript SDK - fetch quotes, execute purchases, build your own UI.
Full Control