Skip to content

Instantly share code, notes, and snippets.

@LiranCohen
Created July 17, 2024 21:58
Show Gist options
  • Save LiranCohen/a2a43b6ff6c31447e64c7feaa808a44b to your computer and use it in GitHub Desktop.
Save LiranCohen/a2a43b6ff6c31447e64c7feaa808a44b to your computer and use it in GitHub Desktop.
Connect Example to Google Hosted Community Node
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