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

# Arianee Privacy Gateway

Methods related to content delivery in a private way are covered.

## Introduction

<Glossary>NFT</Glossary> content could be a plain JSON file self hosted and requestable as a GET ressource. But in that case, the NFT content is completely public.

Usually, brands want to be able to make their NFT content private but still transferable and sharable. To do so, brands need the Arianee Privacy Gateway - agnostic type of database to check the rights. It has two functions:

* Store the content
* Deliver the content

An Arianee Privacy Gateway implementation is based on JSON RPC and should expose few methods.

Our team developed a middleware to manage all these aspects for you. You just have to connect that middleware to your content warehouse. The middleware handles the security for you.

> 📌
>
> * Middleware: arianee-rpc-server
> * <a href="https://github.com/Arianee/arianee-rpc-server/" target="_blank">GitHub repo</a>
> * <a href="https://www.npmjs.com/package/@arianee/arianee-rpc-server" target="_blank">NPM package</a>

***

## Installation

1. We recommend you employ the certification module as an NPM package in your application.

```
$ npm i --save @arianee/arianee-rpc-server
```

2. To import the package inside your app.

```javascript
import { ArianeeRPCCustom } from "@arianee/arianee-rpc-server";
import {NETWORK} from "@arianee/arianeejs";
const arianeeRPC=new ArianeeRPCCustom(NETWORK.mainnet);
```

***

## Use

This gateway is a server-side application. You need to use a node web server and implement arianee-rpc-server. You need to implement methods and write your own code to connect to your content warehouse.

```javascript
const certificateContent=(certificateId)=> {

    // Connect to you database / filesystem / document warehouse...
    // Locate certificate content referenced with id : certificateId
    // grab it
    // store it into JsonCertificateContent variable

    Promise.resolve(JsonCertificateContent);

}

arianeeRPC.setCertificateContent(certificateContent);


const rpcServer = arianeeRPC.build();
 
app.post("/rpc", (req, res, next) => rpcServer(req, res, next));
// Or shorter
// app.post("/rpc",rpcServer);
```

> 📌
>
> The endpoint needs to be defined into the brand identity JSON as endpoint RPC key.

***

## Basic implementation using express

```javascript
import { ArianeeRPCCustom } from "../arianeeRPCServer";
import {NETWORK} from "@arianee/arianeejs/dist/src";

const express = require("express");
const app = express();
const port = process.env.PORT || 3000;

var bodyParser = require("body-parser");

// Certificate content array
const certificatesDB={};

// Events content array
const eventsDB={}

const SessionDBRPC = (network=NETWORK.arianeeTestnet)=> new ArianeeRPCCustom(network)
    .setCertificateContentMethods(
        (certificateid:string)=>{
      return Promise.resolve(certificatesDB[certificateid])
    },
        (certificateid:string, data)=>{
      certificatesDB[certificateid] = data;
      return Promise.resolve();
    })
    .setEventContentMethods(
        (certificateid)=>{
      return Promise.resolve(eventsDB[certificateid])
    },
        (certificateid:string, data)=>{
            eventsDB[certificateid] = data;
      return Promise.resolve();
    })
  .build();

const arianeeRpcServer = SessionDBRPC();

app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());

app.post("/rpc", (req, res, next) => arianeeRpcServer(req, res, next));

app.listen(port, () => console.log(`Example app listening on port ${port}!`));
```

***

## Methods list

### Set NFT content

This method can implement three custom methods:

* Reading NFT content.
* Storing NFT content.
* Storing NFT content which does not exist on the <Glossary>Blockchain</Glossary>.

```javascript
arianeeRPC.setCertificateContent(promise certificateRead(certificateId), promise certificateCreate(certificateId, content), promise certificateCreateWithoutValidationOnBC(certificateId, content) );
```

**Reading NFT**

```javascript
(certificateId:string)=>{

      // This code is called only is the request is allowed to read certificate content
      // You need to use certificateId reference to read certificate content into your database / other storage system
      // and resolve the content

      return Promise.resolve(certificateContent)
    }
```

**Creating NFT**

```javascript
(certificateId:string, content:string)=>{

      // This code is called only if the request is allowed to store certificate content
      // You need to use certificateId reference to store certificate content into your database / other storage system
      // and resolve the promise

      return Promise.resolve()
    }
```

**Create NFT without blockchain confirmation**

```javascript
(certificateId:string, content:string)=>{

      // This code is called only if the request is allowed to store certificate content
      // You need to use certificateId reference to store certificate content into your database / other storage system
      // and resolve the promise

      return Promise.resolve()
    }
```

***

### Update content message

This method can implement three custom methods:

* Reading update content.
* Storing update content.
* Storing update content which does not exist on the blockchain.

```javascript
arianeeRPC.setUpdateContent(promise fetchUpdateContent(certificateId), promise createUpdate(certificateId, content),promise createEventWithoutValidationOnBC(certificateId, content) );
```

### Reading update

```javascript
(eventId:string)=>{

      // This code is called only is the request is allowed to read certificate update content
      // You need to use eventId reference to read event content into your database / other storage system
      // and resolve the content

      return Promise.resolve(eventContent)
    }
```

### Creating update

```javascript
(certificate:string, content:string)=>{

      // This code is called only if the request is allowed to store certificate update content
      // You need to use eventId reference to store event content into your database / other storage system
      // and resolve the promise

      return Promise.resolve()
    }
```

### Creating update without blockchain confirmation

```javascript
(certificateId:string, content:string)=>{

      // This code is called only if the request is allowed to store certificate update content
      // You need to use eventId reference to store event content into your database / other storage system
      // and resolve the promise

      return Promise.resolve()
    }
```

***

### Set message content

This method can implement three custom methods:

* Reading message content.
* Storing message content.
* Storing message content which does not exist on the blockchain.

```javascript
arianeeRPC.setMessageContent(promise fetchMessageContent(eventId), promise createMessage(eventId, content), promise createEventcreateMessageWithoutValidationOnBC(eventId, content) );
```

### Read message

```javascript
(messageId:string)=>{

      // This code is called only is the request is allowed to read message content
      // You need to use messageId reference to read message content into your database / other storage system
      // and resolve the content

      return Promise.resolve(messageContent)
    }
```

### Create message

```javascript
(messageId:string, content:string)=>{

      // This code is called only if the request is allowed to store message content
      // You need to use messageId reference to store message content into your database / other storage system
      // and resolve the promise

      return Promise.resolve()
    }
```

### Create message without blockchain confirmation

```javascript
(messageId:string, content:string)=>{

      // This code is called only if the request is allowed to store message content
      // You need to use messageId reference to store message content into your database / other storage system
      // and resolve the promise

      return Promise.resolve()
    }
```

***

### Set event content

This method can implement three custom methods:

* Reading event content.
* Storing event content.
* Storing event content which does not exist on the blockchain.

```javascript
arianeeRPC.setEventContent(promise fetchEventContent(eventId), promise createEvent(eventId, content), promise createEventWithoutValidationOnBC(eventId, content) );
```

### Read event

```javascript
(eventId:string)=>{

      // This code is called only is the request is allowed to read event content
      // You need to use eventId reference to read event content into your database / other storage system
      // and resolve the content

      return Promise.resolve(eventContent)
    }
```

### Create event

```javascript
(eventId:string, content:string)=>{

      // This code is called only if the request is allowed to store event content
      // You need to use eventId reference to store event content into your database / other storage system
      // and resolve the promise

      return Promise.resolve()
    }
```

### Create event without blockchain confirmation

```javascript
(eventId:string, content:string)=>{

      // This code is called only if the request is allowed to store event content
      // You need to use eventId reference to store event content into your database / other storage system
      // and resolve the promise

      return Promise.resolve()
    }
```