---
updatedAt: 2025-05-19T20:46:02.000Z
agentTools:
  projectIndex: https://docs.arianee.org/v1.0/llms.txt
---

# ArianeeJS Library

ArianeeJS is the first official SDK to interact with the Arianee protocol.

## Introduction

ArianeeJS works on NodeJs and browser.

If you want to play straight away with the library, a [demo](https://arianee-protocol.readme.io/docs/demo) is available directly within your browser.

**Ressources**

ArianeeJS npm: <a href="https://www.npmjs.com/package/@arianee/arianeejs" target="_blank"><https://www.npmjs.com/package/@arianee/arianeejs></a>

ArianeeJS Library repo: <a href="https://github.com/Arianee/arianeeJS" target="_blank"><https://github.com/Arianee/arianeeJS></a>

> 🔧
>
> To report a bug, report an issue in the Github repo. Provide as much detail as possible.

## Install

Use the certification module as a NPM package in your application.

```
$ npm i --save @arianee/arianeejs 
```

Import the package inside your app.

```javascript
import { Arianee } from '@arianee/arianeejs'
```

*Optional -* If you wish to use it directly in your browser with javascript, you can include:

```html
<script src="https://unpkg.com/@arianee/arianeejs@latest/browser/bundle.js">
</script> 
```

## Demo

This code is for demonstration purpose, so we can use `@latest` bundle. In real world, you should always add SRI (sub-resource integrity) as recommended by W3C: <a href="https://www.w3.org/TR/SRI/" target="_blank"><https://www.w3.org/TR/SRI/></a>

```html
<script src="https://unpkg.com/@arianee/arianeejs@1.8.0/browser/bundle.js" 
integrity="sha384-Ay7oXTEIhZSeW8AFjocYolR96Vl14omuBh2PcTiCuO5tkU1B6NOGqHzZwwVT3XC+" 
crossorigin="anonymous"></script>
```

## Initialize

Instantiate ArianeeJS.

```javascript
new Arianee();
```

```javascript
Arianee.init([networkName], [arianeeCustomConfiguration]);
```

<Table align={["left","left","left","left"]}>
  <thead>
    <tr>
      <th>
        Parameter
      </th>

      <th>
        Type
      </th>

      <th>
        Mandatory
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `networkName`
      </td>

      <td>
        String
      </td>

      <td>
        ❌
      </td>

      <td>
        The network to use `mainnet` or `testnet`.\
        Default : `testnet`
      </td>
    </tr>

    <tr>
      <td>
        `arianeeCustomConfiguration`
      </td>

      <td>
        Object
      </td>

      <td>
        ❌
      </td>

      <td>
        Some options can be overriden.
      </td>
    </tr>

    <tr>
      <td>
        `arianeeCustomConfiguration` → `walletReward`
      </td>

      <td>
        `object\<{address:string>`
      </td>

      <td>
        ❌
      </td>

      <td>
        Address of wallet to be rewarded.
      </td>
    </tr>

    <tr>
      <td>
        `arianeeCustomConfiguration` → `brandDataHubReward`
      </td>

      <td>
        `object\<{address:string>`
      </td>

      <td>
        ❌
      </td>

      <td>
        Address of NFT Management Platform to be rewarded.
      </td>
    </tr>

    <tr>
      <td>
        `arianeeCustomConfiguration` → `httpProvider`
      </td>

      <td>
        `provider`
      </td>

      <td>
        ❌
      </td>

      <td>
        Provider as defined by web3js.
      </td>
    </tr>

    <tr>
      <td>
        `arianeeCustomConfiguration` → `transactionOptions`
      </td>

      <td>
        `object\<gas:number, gasPrice:any>`
      </td>

      <td>
        ❌
      </td>

      <td>
        Transaction options.
      </td>
    </tr>

    <tr>
      <td>
        `arianeeCustomConfiguration` → `deeplink`
      </td>

      <td>
        String
      </td>

      <td>
        ❌
      </td>

      <td>
        Deeplink to be used by ArianeeJS to create deeplink.
      </td>
    </tr>

    <tr>
      <td>
        `arianeeCustomConfiguration` → `protocolConfiguration`
      </td>

      <td>
        Object
      </td>

      <td>
        ❌
      </td>

      <td>
        Arianee protocol configuration. If not specified, the library will fetch the configuration depending on the `networkName`.
      </td>
    </tr>

    <tr>
      <td>
        `arianeeCustomConfiguration` → `defaultArianeePrivacyGateway`
      </td>

      <td>
        String
      </td>

      <td>
        ❌
      </td>

      <td>
        Default Arianee Privacy Gateway URL where will be stored NFT content.
      </td>
    </tr>
  </tbody>
</Table>

**Result:** `promise` returns `object`- ArianeeWalletBuilder object. The Arianee instance with the choosen network.

> 📌
>
> Initialization is asynchronous. You need to use await or a promise.

**Example:**

```javascript
const arianeeLib = new Arianee();
const arianee = await arianeeLib.init("testnet");
```

## Set default Query

Instantiate ArianeeJS.

```javascript
new Arianee();
```

```javascript
Arianee.setDefaultQuery(ConsolidatedCertificateRequest);
```

<Table align={["left","left","left","left"]}>
  <thead>
    <tr>
      <th>
        Parameter
      </th>

      <th>
        Type
      </th>

      <th>
        Mandatory
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `networkName`
      </td>

      <td>
        String
      </td>

      <td>
        ❌
      </td>

      <td>
        The network to use `mainnet` or `testnet`.\
        Default : `testnet`
      </td>
    </tr>
  </tbody>
</Table>

**Result:** Arianee returns `object` - Arianee object. The Arianee instance.

**Example:**

```javascript
const arianee = new Arianee()
    .setDefaultQuery({content:true})
    .init();
```