> For the complete documentation index, see [llms.txt](https://doc.xendbridge.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.xendbridge.com/xendbridge-sdks/xendbridge-nodejs-sdk.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
