# XendBridge NodeJs SDK

Xendbridge provides a NodeJs SDK which can be integrated by installing directly from the Node Package Manager. This library abstracts the necessary API endpoints required to interact with the XendBridge P2P application into javascript functions. The package details can be found at <https://www.npmjs.com/package/@xendbridge/nodejssdk>

#### Setup

The steps below can be used to integrate the sdk to your NodeJs application

1. npm install @xendbridge/nodejssdk
2. Create a config folder on your application's root directory
3. Create an {environment}.json file (eg. Sandbox.json)  in the config folder and add the json object below

```json
{ 
    "baseUrl": "xendbridge base url", 
    "publicKey": "Your xendbridge public key", 
    "secretKey": "Your xendbridge secret key" 
} 
```

Please note that the {environment}.json file should correspond to your app's deployment environment (eg. development, sandbox, production).&#x20;

4. Replace the property values with the appropriate xendbridge base URL and keys. See [Get Started](/get-started.md#environments) and [Get Started](/get-started.md#keys) to get your keys and urls.
5. Import the XendBridge library into your javascript file using the code below and you'd be able to interract with the XendBridge api

```javascript
const xendbridgeSDK = require('@xendbridge/nodejssdk')
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.xendbridge.com/xendbridge-sdks/xendbridge-nodejs-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
