Hub JS Package

Hub JS Package

  • Users
  • Buckets
  • Threads
  • Textile Docs

›Users API

Users API

  • Users.getUsage() method
  • Users.setupMailbox() method
  • Users.getMailboxID() method
  • Users.sendMessage() method
  • Users.watchInbox() method
  • Users.watchSentbox() method
  • Users.listSentboxMessages() method
  • Users.deleteSentboxMessage() method
  • Users.listInboxMessages() method
  • Users.readInboxMessage() method
  • Users.deleteInboxMessage() method
  • Users.listThreads() method
  • Users.getThread() method
  • Users.copyAuth() method
  • Users.withUserAuth() method
  • Users.withKeyInfo() method
  • Users.getToken() method
  • Users.getTokenChallenge() method
  • Users.setToken() method
  • Users.withThread() method

Types

  • GetThreadResponse interface
  • InboxListOptions interface
  • MailboxEvent interface
  • MailboxEventType enum
  • PushPathResult interface
  • PushPathsResult interface
  • SentboxListOptions interface
  • UserMessage interface
  • UsageOptions interface
  • GetUsageResponse interface

Identity interfaces

  • Identity interface
  • Identity.public property
  • Identity.sign() method
  • Private interface
  • Public interface
  • Public.bytes property
  • Public.verify() method

Private Key Class

  • PrivateKey class
  • PrivateKey.bytes property
  • PrivateKey.canSign() method
  • PrivateKey.decrypt() method
  • PrivateKey.fromRandom() method
  • PrivateKey.fromString() method
  • PrivateKey.privKey property
  • PrivateKey.pubKey property
  • PrivateKey.public property
  • PrivateKey.sign() method
  • PrivateKey.seed property
  • PrivateKey.toString() method
  • PrivateKey.type property
  • PrivateKey.fromRawEd25519Seed() method

Public Key Class

  • PublicKey class
  • PublicKey.fromString() method
  • PublicKey.toString() method
  • PublicKey.verify() method
  • PublicKey.encrypt() method
  • PublicKey.bytes property
  • PublicKey.type property
  • PublicKey.pubKey property

@textile/hub > Users > copyAuth

Users.copyAuth() method

Copies the full scope and authentication from one API instance to this one. This will copy any existing authentication and authorization info, including:

  • Information created withKeyInfo and withUserAuth.

  • Any token generated from getToken or getTokenChallenge.

  • If you scoped the instance to a specific thread using withThread

Signature:

static copyAuth(auth: GrpcAuthentication, options?: CopyAuthOptions): Users;

Parameters

ParameterTypeDescription
authGrpcAuthenticationany authenticated API class such as Users or Buckets.
optionsCopyAuthOptions

Returns:

Users

Example 1

Copy an authenticated Users api instance to Buckets.

import { Buckets, Users } from '@textile/hub'

const usersToBuckets = async (user: Users) => {
  const buckets = Buckets.copyAuth(user)
  return buckets
}

Example 2

Copy an authenticated Buckets api instance to Users.

import { Buckets, Users } from '@textile/hub'

const bucketsToUsers = async (buckets: Buckets) => {
  const user = Users.copyAuth(buckets)
  return user
}

← Users.getThread() methodUsers.withUserAuth() method →
  • Users.copyAuth() method
  • Parameters
  • Example 1
  • Example 2
Hub JS Package
Docs
Getting StartedThreadDBBuckets
Resources
All DocumentationProject SlackBlog
More
GitHubStar
Follow @textileio