Created
July 17, 2024 21:58
-
-
Save LiranCohen/a2a43b6ff6c31447e64c7feaa808a44b to your computer and use it in GitHub Desktop.
Connect Example to Google Hosted Community Node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { did, web5 } = await Web5.connect({ | |
didCreateOptions: { | |
dwnEndpoints: ['https://dwn.gcda.xyz'] // User provides google's community DWN instance | |
}, | |
registration: { | |
onSuccess: () => { | |
// Registration succeeded, set a local storage value to indicate the user is registered and registration does not need to occur again. | |
}, | |
onFailure: (error) => { | |
// Registration failed, display an error message to the user, and pass in the registration object again to retry next time the user connects. | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment