# Rocketfuel SDK nodejs

## Rocketfuel Node.js SDK Integration Guide <a href="#undefined" id="undefined"></a>

This document provides a step-by-step guide for integrating Rocketfuel’s Node.js SDK (`rocketfuel-sdk`) to generate invoices and perform purchase checks in your application.

### Prerequisites <a href="#undefined" id="undefined"></a>

* Node.js installed
* An active Rocketfuel account with access credentials:
  * `CLIENT_ID`
  * `CLIENT_SECRET`
  * `MERCHANT_ID`

### Installation

<pre class="language-bash"><code class="lang-bash"><strong>npm install @rkfl/transact-server
</strong></code></pre>

```javascript
import { Rocketfuel } from '@rkfl/transact-server';
```

### **Reading Credentials from Environment Variables**

Use environment variables for security and flexibility.

```javascript
export const CLIENT_ID = process.env.CLIENT_ID;
export const CLIENT_SECRET = process.env.CLIENT_SECRET;
export const MERCHANT_ID = process.env.MERCHANT_ID;
```

### **Initializing the Rocketfuel Client**

Initialize the `RocketfuelClient` with appropriate parameters:

```javascript
const client = new Rocketfuel({
  clientId: CLIENT_ID,
  clientSecret: CLIENT_SECRET,
  merchantId: MERCHANT_ID,
  environment: 'sandbox', // or 'production'
});
```

### References

* PayIn Integration - [Link](/plug-ins-and-sdks/javascript-js/rocketfuel-sdk-nodejs/payin.md)
* Payout Integration - [Link](/plug-ins-and-sdks/javascript-js/rocketfuel-sdk-nodejs/payouts.md)
* Age Verification - [Link](/plug-ins-and-sdks/javascript-js/rocketfuel-sdk-nodejs/age-verification.md)

####


---

# 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://docs.rocketfuel.inc/plug-ins-and-sdks/javascript-js/rocketfuel-sdk-nodejs.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.
