Space SDK Package

Space SDK Package

  • Users
  • Storage
  • Space Docs

@spacehq/sdk > UserStorage > shareViaPublicKey

UserStorage.shareViaPublicKey() method

shareViaPublicKey shares specified files to users who owns the specified public keys.

Signature:

shareViaPublicKey(request: ShareViaPublicKeyRequest): Promise<ShareViaPublicKeyResponse>;

Parameters

ParameterTypeDescription
requestShareViaPublicKeyRequest

Returns:

Promise<ShareViaPublicKeyResponse>

Example

const result = await spaceStorage.shareViaPublicKey({
  publicKeys: [{
     id: 'user@email.com', // or any identifier for the user
     pk: 'user-pk-hex-or-multibase', // optional, omit if user doesn't exist yet, it would generate temp access key
  }],
  paths: [{
     bucket: 'personal',
     path: '/file/path/here'
  }],
});


  • UserStorage.shareViaPublicKey() method
  • Parameters
  • Example
Space SDK Package
Docs
Getting StartedUsersStorage
Resources
All DocumentationProject SlackBlog
More
GitHubStar
Follow @spacestorage