Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
@0xsequence/kit
Advanced tools
Sequence Kit 🧰 is a library enabling developers to easily integrate web3 wallets in their app. It is based on wagmi and supports all wagmi features.
View the demo! 👀
@0xsequence/kit
is the core package. Any extra modules require this package to be installed first.
To install this package:
npm install @0xsequence/kit @0xsequence/kit-connectors wagmi ethers@5.7.2 viem 0xsequence
# or
pnpm install @0xsequence/kit @0xsequence/kit-connectors wagmi ethers@5.7.2 viem 0xsequence
# or
yarn add @0xsequence/kit @0xsequence/kit-connectors wagmi ethers@5.7.2 viem 0xsequence
React apps must be wrapped by a Wagmi client and the KitWalletProvider components. It is important that the Wagmi wrapper comes before the Sequence Kit wrapper.
import MyPage from './components/MyPage'
import { KitProvider } from '@0xsequence/kit'
import { getDefaultConnectors } from '@0xsequence/kit-connectors'
import { configureChains, createConfig, WagmiConfig } from 'wagmi'
import { publicProvider } from 'wagmi/providers/public'
import { mainnet, polygon } from 'wagmi/chains'
function App() {
const { chains, publicClient, webSocketPublicClient } = configureChains(
[polygon, mainnet],
[publicProvider()],
)
const connectors = getDefaultConnectors({
chains,
walletConnectProjectId: 'project_id',
defaultChainId: 137
})
const config = createConfig({
autoConnect: true,
publicClient,
webSocketPublicClient,
connectors
})
return (
<WagmiConfig config={config}>
<KitProvider>
<MyPage />
</KitProvider>
</WagmiConfig>
);
}
Wallet selection is done through a modal which can be called programmatically.
import { useOpenConnectModal } from '@0xsequence/kit'
import { useDisconnect, useAccount } from 'wagmi'
const MyReactComponent = () => {
const { setOpenConnectModal } = useOpenConnectModal()
const { isConnected } = useAccount()
const onClick = () => {
setOpenConnectModal(true)
}
return (
<>
{!isConnected && (
<button onClick={onClick}>
Sign in
</button>
)}
</>
)
}
Use the useOpenConnectModal
to change to open or close the connection modal.
import { useOpenConnectModal } from '@0xsequence/kit'
// ...
const { setOpenConnectModal } = useOpenConnectModal()
setOpenConnectModal(true)
Use the useTheme
hook to get information about the current theme, such as light or dark, or set it to something else.
import { useTheme } from '@0xsequence/kit'
const { theme, setTheme } = useTheme()
setTheme('light')
The KitProvider
wrapper can accept an optional config object.
The settings are described in more detailed in the Sequence Kit documentation.
const kitConfig = {
defaultTheme: 'light',
position: 'top-left',
signIn: {
logoUrl: 'https://logo-dark-mode.svg',
projectName: 'my app',
showEmailInput: true,
miniAuthOptions: ['google', 'facebook', 'twitch', 'apple'],
authOptions: ['metamask', 'wallet-connect'],
},
// limits the digital assets displayed on the assets summary screen
displayedAssets: [
{
contractAddress: ethers.constants.AddressZero,
chainId: 137,
},
{
contractAddress: '0x631998e91476da5b870d741192fc5cbc55f5a52e',
chainId: 137
}
],
}
<KitProvider config={kitConfig}>
<App />
<KitProvider>
Package | Description | Docs |
---|---|---|
@0xsequence/kit | Core package for Sequence Kit | Read more |
@0xsequence/kit-connectors | Connectors for sequence kit including popular web3 wallets and social logins | Read more |
@0xsequence/kit-wallet | Embedded wallets for viewing and sending coins and collectibles | Read more |
@0xsequence/kit-checkout | Checkout modal with fiat onramp | Read more |
@0xsequence/kit-example-react | Example application showing sign in, wallet and checkout | Read more |
The React example can be used to test the library locally.
pnpm install
pnpm watch
to build the package in watch mode in one console.pnpm start:react
to run the react example in another console.Now that the core package is installed, you can install the embedded wallet or take a look at the checkout.
Apache-2.0
Copyright (c) 2017-present Horizon Blockchain Games Inc. / https://horizon.io
FAQs
Core package for Sequence Kit
The npm package @0xsequence/kit receives a total of 492 weekly downloads. As such, @0xsequence/kit popularity was classified as not popular.
We found that @0xsequence/kit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.