Hub JS Package

Hub JS Package

  • Users
  • Buckets
  • Threads
  • Textile Docs

@textile/hub > Filecoin > withUserAuth

Filecoin.withUserAuth() method

Creates a new API client instance for accessing the gRPC API using User Group key authentication. This method is recommended for public apps where API secrets need to remain hidden from end users.

Signature:

static withUserAuth(auth: UserAuth | (() => Promise<UserAuth>), options?: WithUserAuthOptions): Filecoin;

Parameters

ParameterTypeDescription
authUserAuth | (() => Promise<UserAuth>)The UserAuth object.
optionsWithUserAuthOptions

Returns:

Filecoin

Example

import { Filecoin, UserAuth } from '@textile/hub'

async function example (userAuth: UserAuth) {
  const filecoin = await Filecoin.withUserAuth(userAuth)
}

  • Filecoin.withUserAuth() method
  • Parameters
  • Example
Hub JS Package
Docs
Getting StartedThreadDBBuckets
Resources
All DocumentationProject SlackBlog
More
GitHubStar
Follow @textileio