Skip to main content

@nuclia/core / Exports / Nuclia

Class: Nuclia

Implements

Table of contents

Constructors

Properties

Accessors

Constructors

constructor

new Nuclia(options)

Depending on your use case, you might want to:

  • Use the Nuclia SDK to access and manage a Nuclia account. In this case you will need to provide the backend and account options, and you will use account authentication.
  • Use the Nuclia SDK to use a Nuclia Knowledge Box. In this case you will need to provide the backend, knowledgeBox and zone options. You will also either use knowledge box authentication, or no authentication if the Knowledge Box is public.

Example:

const nuclia = new Nuclia({
backend: 'https://nuclia.cloud/api',
knowledgeBox: '17815eb2-06a5-40ee-a5aa-b2f9dbc5da70',
zone: 'europe-1',
});

Parameters

NameType
optionsNucliaOptions

Defined in

libs/sdk-core/src/lib/core.ts:78

Properties

auth

auth: IAuthentication

Allows you to authenticate using username/password or using an API key.

Implementation of

INuclia.auth

Defined in

libs/sdk-core/src/lib/core.ts:11


currentShards

Optional currentShards: Object = {}

Index signature

▪ [kb: string]: string[]

Implementation of

INuclia.currentShards

Defined in

libs/sdk-core/src/lib/core.ts:16


db

db: IDb

Allows you to access and query the Nuclia database.

Implementation of

INuclia.db

Defined in

libs/sdk-core/src/lib/core.ts:15


events

events: Events

Implementation of

INuclia.events

Defined in

libs/sdk-core/src/lib/core.ts:17


options

options: NucliaOptions

Implementation of

INuclia.options

Defined in

libs/sdk-core/src/lib/core.ts:9


rest

rest: IRest

Allows you to make authenticated REST requests to the Nuclia backend.

Implementation of

INuclia.rest

Defined in

libs/sdk-core/src/lib/core.ts:13

Accessors

asyncKnowledgeBox

get asyncKnowledgeBox(): PromiseMapper<KnowledgeBox>

Similar to knowledgeBox, but the returned object exposes Promises instead of RxJS Observables.

Returns

PromiseMapper<KnowledgeBox>

Defined in

libs/sdk-core/src/lib/core.ts:49


backend

get backend(): string

The Nuclia global backend URL.

Returns

string

Implementation of

INuclia.backend

Defined in

libs/sdk-core/src/lib/core.ts:21


knowledgeBox

get knowledgeBox(): KnowledgeBox

Direct access to the current Knowledge Box instance (it returns a Knowledge Box in read mode, and does not work with account authentication).

Returns

KnowledgeBox

Implementation of

INuclia.knowledgeBox

Defined in

libs/sdk-core/src/lib/core.ts:33


regionalBackend

get regionalBackend(): string

The Nuclia regional backend URL.

Returns

string

Implementation of

INuclia.regionalBackend

Defined in

libs/sdk-core/src/lib/core.ts:26