Nym integrations

Integrations page

How can I integrate Nym into my app?

If you're unsure where to start, the following set of questions should help you determine which path to follow in regards to integrations with Nym:

Is your app developed in TS/JS or Rust?

Yes - TS/JS or RUST: If yes, you will either be able to leverage mixFetch (go to step 2 below) or the sdk client to route app traffic through the mixnet. Note that mixfetch currently only works with JS/TS at the moment, as we do not yet have a Rust implementation of it.

Does your TS/JS app rely on fetch for its network traffic and remote connections?

Check whether mixFetch can be used to route your traffic through the mixnet by entering your repository's URL below:

Yes - my repo currently uses fetch: The best way to integrate Nym's mixFetch into your application will be where external network calls and RPC happens, for example, something in the lines of sendRawTransaction if you have an ETH-compatible wallet or JsonRpcClient if you use CosmJS. Although you can simply search for any JS fetch calls in your code (using our tool above) that are easily replaceable with mixFetch, keep in mind that fetch is not the only way to make JSONRPC or XHR calls. We advise to approach the integration process in a semantic way, searching for a module that is the common denominator for external communication in the codebase. Usually these are API controllers, middlewares or repositories.

Use one of our standalone Nym clients

If you've answered 'No' to all of the above, you may need to use one of our standalone clients (opens in a new tab). All Nym client packages present basically the same capabilities to the privacy application developer. They need to run as a persistent process in order to stay connected and ready to receive any incoming messages from their gateway nodes. They register and authenticate to gateways, and construct Sphinx packets. While setting up those, and depending on your usecase, you may need to set-up and run a Service Provider. Read below the "How to deal with Service Providers" section for more details.

                           +-----------------------------------+
                           |                                   |      +---------------------+
                           | Is app JS/TS or another language? +-----+|Go / C / C++ / Swift |+----------------------+
                           |                                   |      +---------------------+                       |
                           +--------+-----------------+--------+                                                    |
                                    |                 |                                                             |
                                    |                 |                                                             |
                               +----+----+         +--+---+                                                         |
                               |  TS/JS  |         | Rust |+-------------------------------------+                  |
                               +----+----+         +------+                                      |                  |
                                    |                                                            |                  |
                  +----+------------+---------------------+--------+--------------+              |                  |
            +-----+----+                                  +--------+              |              |                  |
            | Browser  |                                  | Server |              |              |                  |
            +-----+----+                                  +---+----+              |              |                  |
                  |                                           |                   |              |                  |
          +-------+--------+                              +---+----+              |              |                  |
          |  HTTP requests |                              | nodeJS |              |              |                  |
      +---+-------+--------+----+                         +---+----+              |              |                  |
      |           |             |                             |                   |              |                  |
   +--+--+   +----+----+  +-----+----------+                  |                   |              |                  |
   | yes |   |websocket|  | webRTC or other|                  |                   |              |                  |
   +--+--+   +----+----+  +------+---------+                  |                   |              |                  |
      |           |              |                            |                   |              |                  |
+-----v---+ +-----v-----+   +----v-------+           +--------v---------+    +----v---+     +----v-----+   +--------v---------+
|mixFetch | |Talk to us |   | No support |           | mixFetch nodeJS  |    | TS SDK |     | Rust SDK |   |    FFI* / Nym    |
+---------+ +-----------+   +------------+           +------------------+    +--------+     +----------+   | standalone client|
                                                                                                           +------------------+
 
 * Coming soon™️

When do I need Service Providers?

If you decide to interact with one of the Nym standalone clients (opens in a new tab), then you most likely will need to set-up a Service Provider. The need for a Service Provider mostly depends on your app's goal and architecture (and the endpoint it needs to hit). Again, as detailed in the FAQ:

  • No Service Provider (Network Requester) needed: If you’re running a purely P2P application, then just integrating clients and having some method of sharing addresses should be enough to route your traffic through the mixnet.
  • Network Requester needed (existing or own): If you’re wanting to place the mixnet between your users’ application instances and a server-based backend, you will need a Network Requester. In this case, if your app supports SOCKS5, you could either use an existing NR or, if your app supports SOCKS5 but needs more extensive whitelisting, you could use the network requester service provider binary (opens in a new tab) to proxy these requests to your application backend yourself, with the mixnet ‘between’ the user and your service, in order to prevent metadata leakage being broadcast to the internet.
  • Running your own Service Provider: If your usecase is more complex, you’re wanting to route RPC requests through the mixnet to a blockchain for example, you will need to look into setting up some sort of Service that does the transaction broadcasting for you. You can find examples of such projects on the community applications page (opens in a new tab).
                           +----------------------+
                     +----+| App supports SOCKS5? |+-----+
                     |     +----------------------+      |
                  +--+--+                             +--+--+
                  | yes |                             |  no |
                  +-----+                             +-----+
                     |                                   |
               +------------+                   +-----------------------+
         +----+|App use case|+--+               | Set standalone client |
         |     +------------+   |               |         + SP          |
       needs                  needs             +-----------------------+
         |                      |
 +-------+--------+   +---------+---------+
 |simple whitelist|   |extensive whitelist|
 +----------------+   +-+---------------+-+
         |                      |
+------------------+    +---------------+
| use existing NR  |    | run own NR/SP |
+------------------+    +---------------+
                                       

Other resources

If you'd like to learn more about potential integrations, please make sure to read: