Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Update node.js docs to include .init() or .connect() #492

Closed
BrettCleary opened this issue Nov 14, 2023 · 1 comment
Closed

[Docs] Update node.js docs to include .init() or .connect() #492

BrettCleary opened this issue Nov 14, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@BrettCleary
Copy link

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.

Reference
#409 (comment)
https://docs.metamask.io/wallet/how-to/connect/set-up-sdk/javascript/nodejs/

@BrettCleary BrettCleary added the enhancement New feature or request label Nov 14, 2023
@christopherferreira9
Copy link
Collaborator

Hi @BrettCleary ! Docs are currently being updated and these instructions will be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants