You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs for node.js integration are missing this info
the issue happens because you are not initializing the sdk correctly.
Please check the examples folder or initialize the connection with the following:
const sdk = new MetaMaskSDK(options);
const accounts = await sdk.connect(); // or await sdk.init() then you can call eth_requestAccounts or any other methods.
The error you receive is because you are requesting an rpc method before the sdk has time to initialize and set the provider.
The docs for node.js integration are missing this info
Reference
#409 (comment)
https://docs.metamask.io/wallet/how-to/connect/set-up-sdk/javascript/nodejs/
The text was updated successfully, but these errors were encountered: