@nuclia/core
TypeScript icon, indicating that this package has built-in type declarations

1.15.0 • Public • Published

Nuclia JavaScript SDK

Nuclia SDK is an open-source library wrapping Nuclia API in order to integrate Nuclia services in your frontend application.

It supports both JavaScript and TypeScript.

The full documentation is available at https://docs.nuclia.dev/docs/docs/sdk/js-sdk/.

Basic usage

import { Nuclia } from '@nuclia/core';

const nuclia = new Nuclia({
  backend: 'https://nuclia.cloud/api',
  zone: 'europe-1',
  knowledgeBox: '<YOUR-KB-ID>',
});
nuclia.knowledgeBox
  .search('where does the Little Prince live', [Search.Features.PARAGRAPH])
  .subscribe((searchResult) => {
    console.log('search result', searchResult);
  });

Usage with NodeJS

This SDK can work in NodeJS by providing some polyfills for localStorage and fetch:

const { Nuclia } = require('@nuclia/core');
require('localstorage-polyfill');
require('isomorphic-unfetch');

const nuclia = new Nuclia({
  backend: 'https://nuclia.cloud/api',
  zone: 'europe-1',
  knowledgeBox: '<YOUR-KB-ID>',
});

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @nuclia/core

      Weekly Downloads

      81

      Version

      1.15.0

      License

      MIT

      Unpacked Size

      488 kB

      Total Files

      77

      Last publish

      Collaborators

      • ebrehault
      • ramon-nuclia
      • ramonnb