Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Cafes

Cafes is an API module for managing Cafe access, messages, and services

Cafes are other peers on the network who offer pinning, backup, and inbox services.

extends

API

Hierarchy

  • API
    • Cafes

Index

Constructors

Methods

Constructors

constructor

Methods

add

  • add(cafe: string, token: string): Promise<CafeSession>
  • Registers with a cafe and saves an expiring service session token

    An access token is required to register, and should be obtained separately from the target Cafe.

    see

    Tokens#create

    Parameters

    • cafe: string

      The host Cafe address

    • token: string

      An access token supplied by the target Cafe

    Returns Promise<CafeSession>

    A new Cafe session JWT

get

  • Retrieves information about a cafe session

    Parameters

    • id: string

      ID of the target Cafe

    Returns Promise<CafeSession>

    A Cafe session JWT

list

messages

  • messages(): Promise<boolean>
  • Checkes for messages at all cafes.

    New messages are downloaded and processed opportunistically.

    Returns Promise<boolean>

    Whether the operation was successfull

remove

  • remove(id: string): Promise<boolean>
  • Deregisters with a cafe and removes local session data

    Note: pinned content will expire based on the Cafe’s service rules.

    Parameters

    • id: string

      ID of the target Cafe

    Returns Promise<boolean>

    Whether the deregistration was successfull