JavaScript library for the FIWARE Context Broker services (web browsers & Node.js)
npm install ngsijs



NGSI.js is the JavaScript library used by
WireCloud for adding FIWARE NGSI
capabilities to widgets and operators. However, this library has also been
designed to be used in other environments as normal web pages and
clients/servers running on Node.js.
This library has been developed following the FIWARE
NGSI v1,
NGSI v2 and the
NGSI-LD specifications
and has been tested to work against version 0.26.0+ of the Orion Context Broker.
Reference documentation of the API is available at
http://ficodes.github.io/ngsijs/stable/NGSI.html.
## Using NGSI.js from normal web pages
> Note: Support for Cross-Origin Resource Sharing (CORS) has been added on
> orion 1.10.0. This support must be enabled to access the context broker from a
> web page in a different domain than the context broker.
>
> CORS support can also be enabled by accessing to the context broker server
> using some proxies, like cors-anywhere
> or the FIWARE's pep proxy.
>
> You can access any context broker server (without requiring CORS support and
> regardless of the context broker version) if the context broker is accessible
> throught the same domain as the web page. How to create such configuration is
> out of the scope of this documentation.
Just include a element linking to the NGSI.min.js file:
``html`
Once added the