@keys-pub/tsclient
TypeScript icon, indicating that this package has built-in type declarations

0.1.8 • Public • Published

tsclient

yarn add @keys-pub/tsclient
import {Credentials, rpcService, RPCService, certPath, RPCError} from '@keys-pub/tsclient'

export const creds: Credentials = new Credentials(certPath('MyApp'))
export const rpc: RPCService = rpcService('localhost:22405', creds)

// Authenticate with service
const auth = await rpc.authUnlock({
  secret: 'mypassword',
  type: AuthType.PASSWORD_AUTH,
  client: 'myapp',
})
// Set auth token from unlock on the service auth
creds.token = auth.authToken

// Search
const search = await rpc.search({})
console.log('Search:', search)

Publishing

npm login
npm publish --access public

Readme

Keywords

none

Package Sidebar

Install

npm i @keys-pub/tsclient

Weekly Downloads

11

Version

0.1.8

License

MIT

Unpacked Size

506 kB

Total Files

46

Last publish

Collaborators

  • gabrielha2