> 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
