
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@metamask/sdk-react-ui
Advanced tools
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.
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
Contact the MetaMask SDK team for a complimentary design optimization workshop here
FAQs
A react component and react hooks to connect and use MetaMask
We found that @metamask/sdk-react-ui demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.