Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@metamask/sdk-react-ui

Package Overview
Dependencies
Maintainers
11
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/sdk-react-ui

A react component and react hooks to connect and use MetaMask

  • 0.28.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
964
decreased by-44.28%
Maintainers
11
Weekly downloads
 
Created
Source

MetaMask SDK React

The MetaMask SDK React UI allows developer an easier integration to the MetaMask SDK on React-based apps. On top of exporting the hooks from @metamask/sdk-react, it also provides wrapper around wagmi hooks and a basic UI button component to connect to MetaMask.

Getting Started

Install the ui sdk package:

yarn add @metamask/sdk-react-ui

Wrap your application in the provider

import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import { MetaMaskUIProvider } from '@metamask/sdk-react-ui';

const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);

root.render(
  <React.StrictMode>
    <MetaMaskUIProvider sdkOptions={{
      dappMetadata: {
        name: "Demo UI React App",
      }
    }}>
      <App />
    </MetaMaskUIProvider>
  </React.StrictMode>
);

Use the SDK in your components:

import { MetaMaskButton } from '@metamask/sdk-react-ui';
import React, { useState } from 'react';

export const App = () => {
  return (
    <div className="App">
      <MetaMaskButton theme={'light'} color="white"></MetaMaskButton>
    </div>
  );
};

Look for more examples at https://github.com/MetaMask/metamask-sdk/tree/main/packages/examples

Contacts

Contact the MetaMask SDK team for a complimentary design optimization workshop here

Keywords

FAQs

Package last updated on 05 Sep 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc