Socket
Book a DemoInstallSign in
Socket

@belongnet/metakeep-wagmi-connector

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@belongnet/metakeep-wagmi-connector

Metakeep connector for Wagmi

0.5.2
latest
Source
npmnpm
Version published
Maintainers
0
Created
Source

metakeep-wagmi-connector

metakeep-wagmi-connector

Version Downloads install size

Connector for integrating wagmi v2.x with the MetaKeep.xyz platform.

  • 👀 Demo

Features:

  • ⚙ Connects with wagmi v2
  • 🔮 Supports Reown AppKit (Web3Modal)
  • 📐 Session validations and caching
  • 🔐 Supports One-Click Auth / SIWE
  • 💡 Lightweight ~26kB
  • ✍️ TypeScript/ESM/Dynamic import

Installation

You can install metakeep-wagmi-connector using npm, yarn, or pnpm:

pnpm add @belongnet/metakeep-wagmi-connector

Once installed, add metakeep to your wagmi configuration as a connector. Here's a sample configuration:

import { metaKeep } from '@belongnet/metakeep-wagmi-connector'

const config = createConfig({
  // ...
  connectors: [
    metaKeep({
      appId: import.meta.env.VITE_META_KEEP_APP_ID,
    }),
  ],
})

Make sure to set the appId in your environment variables, for example in a .env file:

VITE_META_KEEP_APP_ID=your-app-id

Enjoy!

Usage

The connector will automatically handle the authentication process with wagmi. see the wagmi documentation for more information.

const { connect } = useConnect()

connect({ connector: 'metakeep' })

Metakeep Provider access

You can use the useAccount hook to access the native connector provider.

[!WARNING] Use this only if you know what you're doing. Instead, it's better to utilize methods at the wagmi level.

import type { MetaKeepProvider } from '@belongnet/metakeep-wagmi-connector'

const { connector } = useAccount()

const provider = <MetaKeepProvider>await connector.value?.getProvider()

const authorizedUser = provider.getUser()
console.log(authorizedUser)

Config

The connector accepts the following options:

appId - MetaKeep App ID

You can get the appId from the MetaKeep dashboard.

metaKeep({
  appId: import.meta.env.VITE_META_KEEP_APP_ID,
}),

name - Custom connector name

You can set a custom name for the connector, by default it's MetaKeep.

metaKeep({
  name: 'MyMetaKeep',
}),

Migration Guide

License

This project is licensed under the terms of the MIT license.

Keywords

metakeep

FAQs

Package last updated on 11 Nov 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.