Hub JS Package

Hub JS Package

  • Users
  • Buckets
  • Threads
  • Textile Docs

›Buckets

Buckets

  • Buckets.copyAuth() method
  • Buckets.withUserAuth() method
  • Buckets.withKeyInfo() method
  • Buckets.getToken() method
  • Buckets.getTokenChallenge() method
  • Buckets.setToken() method
  • Buckets.withThread() method
  • Buckets.getOrCreate() method
  • Buckets.create() method
  • Buckets.existing() method
  • Buckets.root() method
  • Buckets.links() method
  • Buckets.list() method
  • Buckets.listPath() method
  • Buckets.listPathFlat() method
  • Buckets.listIpfsPath() method
  • Buckets.movePath() method
  • Buckets.open() method
  • Buckets.pushPath() method
  • Buckets.pushPaths() method
  • Buckets.pushPathAccessRoles() method
  • Buckets.pullPath() method
  • Buckets.pullPathAccessRoles() method
  • Buckets.pullIpfsPath() method
  • Buckets.remove() method
  • Buckets.removePath() method
  • Buckets.setPath() method

Experimental

  • Archive interface
  • ArchiveDealInfo interface
  • ArchiveStatus enum

Types

  • GetOrCreateOptions interface
  • GetOrCreateResponse interface
  • CreateOptions interface
  • CreateResponse interface
  • Links interface
  • Path interface
  • PathAccessRole enum
  • PathItem interface
  • Root interface
  • BuckMetadata interface

@textile/hub > Buckets > copyAuth

Buckets.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): Buckets;

Parameters

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

Returns:

Buckets

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
}

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