Userbase

Docs : SDK : shareDatabase

shareDatabase lets you share a database with another user. Use this function to retrieve a token that any other user can use to open the database, or to share a database directly with another user.

Retrieving a share token:
    
      userbase.shareDatabase({
        databaseName: 'example-database-name'
      }).then(({ shareToken }) => {
        // Any other user can now open the database using this share token      
      }).catch((e) => console.error(e))
    
  
Sharing directly with another user:
    
      userbase.shareDatabase({
        databaseName: 'example-database-name',
        username: 'alice'
      }).then(() => {
        // Alice can now access the database
      }).catch((e) => console.error(e))
    
  

Parameters

Result

Notes

Errors