Skip to main content

Client

A class representing a client to the Blyss bucket service.

Index

Constructors

constructor

  • Initialize a client of the Blyss bucket service.


    Parameters

    • apiConfig: string | ApiConfig

      An API key, or an object containing an API configuration.

    Returns BucketService

Properties

api

api: Api

apiConfig

apiConfig: ApiConfig

serviceEndpoint

serviceEndpoint: string

Methods

connect

  • connect(bucketName: string, secretSeed?: string): Promise<Bucket>
  • Connect to an existing Blyss bucket.


    Parameters

    • bucketName: string

      The name of the bucket to connect to.

    • optionalsecretSeed: string

      An optional secret seed to initialize the client using. The secret seed is used to encrypt client queries. If not supplied, a random one is generated.

    Returns Promise<Bucket>

create

  • create(bucketName: string, openAccess?: boolean, params?: any): Promise<void>
  • Create a Blyss bucket.


    Parameters

    • bucketName: string

      The bucket name. Bucket names must be 1-128 characters long, composed of only lowercase letters ([a-z]), digits ([0-9]), and hyphens (-). If you want to share Blyss buckets across accounts, you can opt-in to the global Blyss namespace by prefixing your bucket name with global.. This is the only way in which the . character is allowed in bucket names.

    • optionalopenAccess: boolean

      If set to true, this bucket will be publicly readable by anyone. You should generally also make the bucket part of the global namespace when setting this option to true. Defaults to false.

    • optionalparams: any

      An optional object of requested parameters for the bucket. Defaults to {}. This is currently unused.

    Returns Promise<void>

exists

  • exists(bucketName: string): Promise<boolean>
  • Check if a Blyss bucket exists.


    Parameters

    • bucketName: string

      The bucket name.

    Returns Promise<boolean>

    Whether a bucket with the given name exists.