Hub JS Package

Hub JS Package

  • Users
  • Buckets
  • Threads
  • Textile Docs

@textile/hub > Filecoin > withKeyInfo

Filecoin.withKeyInfo() method

Creates a new API client instance for accessing the gRPC API using key & secret based authentication. This method is recommended for admin or insecure implementations where the non-signing keys or key with secret can be embedded directly in an app.

Signature:

static withKeyInfo(key: KeyInfo, options?: WithKeyInfoOptions): Promise<Filecoin>;

Parameters

ParameterTypeDescription
keyKeyInfoThe KeyInfo object containing {key: string, secret: string}
optionsWithKeyInfoOptions

Returns:

Promise<Filecoin>

Example

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

async function start () {
  const keyInfo: KeyInfo = {
    key: '<api key>',
    secret: '<api secret>'
  }
  const filecoin = await Filecoin.withKeyInfo(keyInfo)
}

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