Resources > API Reference
Resources > API ReferenceKroxt BaaS SDK v1.0.5

API Reference

Complete constructor methods and option keys supported by the `@kroxt/baas-sdk` package client.

SDK Client Constructors

new Kroxt(options: KroxtOptions)

Instantiates a new Orchestrator Client. Config keys:

  • projectId: string (Required)
  • apiKey: string (Required)
  • baseUrl?: string (Optional. Defaults to production gateway. Only provide if running Kroxt BaaS locally on your machine to point to your dev server)
  • storage?: StorageAdapter (Custom token persistence adapter)
baas.auth
  • .register(payload): Promise<AuthSession>
  • .login(payload): Promise<AuthSession>
  • .me(): Promise<KroxtUser | null>
  • .logout(): Promise<void>
baas.collection(name)
  • .create(data): Promise<Document<T>>
  • .get(id): Promise<Document<T>>
  • .update(id, data): Promise<Document<T>>
  • .delete(id): Promise<boolean>
  • .where(field, op, val) (Query filter builder)