### Install Project Dependencies and Run Tests Source: https://github.com/hyperwallet/node-sdk/blob/master/README.md Install all project dependencies using npm and run the test suite. This is typically done during development or for verifying the project setup. ```bash $ npm install $ npm test ``` -------------------------------- ### Install Hyperwallet Node.js SDK Source: https://github.com/hyperwallet/node-sdk/blob/master/README.md Install the hyperwallet-sdk package using npm. This is a prerequisite for using the SDK in your project. ```bash $ npm install hyperwallet-sdk ``` -------------------------------- ### Instantiate Hyperwallet Client Source: https://github.com/hyperwallet/node-sdk/blob/master/README.md Create an instance of the Hyperwallet Client using your sandbox credentials. Ensure you have your username, password, and program token from the Hyperwallet Program Portal. ```javascript var client = new Hyperwallet({ username: "restapiuser@4917301618", password: "mySecurePassword!", programToken: "prg-645fc30d-83ed-476c-a412-32c82738a20e", }); ``` -------------------------------- ### Create a User with Hyperwallet SDK Source: https://github.com/hyperwallet/node-sdk/blob/master/README.md Make an API call to create a new user using the instantiated Hyperwallet client. The callback function handles success or error responses. ```javascript var userData = { clientUserId: "test-client-id-1", profileType: "INDIVIDUAL", firstName: "Daffyd", lastName: "y Goliath", email: "testmail-1@hyperwallet.com", addressLine1: "123 Main Street", city: "Austin", stateProvince: "TX", country: "US", postalCode: "78701", }; client.createUser(userData, function(errors, body, res) { if (errors) { console.log("Create User Failed"); console.log(errors); } else { console.log("Create User Response"); console.log(body); } }); ``` -------------------------------- ### Require Hyperwallet SDK Source: https://github.com/hyperwallet/node-sdk/blob/master/README.md Include the hyperwallet-sdk in your Node.js file. This makes the SDK's functionalities available for use. ```javascript var Hyperwallet = require("hyperwallet-sdk"); ``` -------------------------------- ### Create User Source: https://github.com/hyperwallet/node-sdk/blob/master/README.md This method allows you to create a new user within the Hyperwallet system. It requires user data including personal information and contact details. ```APIDOC ## createUser ### Description Creates a new user in the Hyperwallet system. ### Method client.createUser(userData, callback) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **userData** (object) - Required - An object containing user details. - **clientUserId** (string) - Required - Unique identifier for the user on the client side. - **profileType** (string) - Required - Type of profile (e.g., 'INDIVIDUAL'). - **firstName** (string) - Required - User's first name. - **lastName** (string) - Required - User's last name. - **email** (string) - Required - User's email address. - **addressLine1** (string) - Required - First line of the user's address. - **city** (string) - Required - User's city. - **stateProvince** (string) - Required - User's state or province. - **country** (string) - Required - User's country code (e.g., 'US'). - **postalCode** (string) - Required - User's postal code. ### Request Example ```javascript var userData = { clientUserId: "test-client-id-1", profileType: "INDIVIDUAL", firstName: "Daffyd", lastName: "y Goliath", email: "testmail-1@hyperwallet.com", addressLine1: "123 Main Street", city: "Austin", stateProvince: "TX", country: "US", postalCode: "78701", }; client.createUser(userData, function(errors, body, res) { if (errors) { console.log("Create User Failed"); console.log(errors); } else { console.log("Create User Response"); console.log(body); } }); ``` ### Response #### Success Response (200) - **body** (object) - The response body containing the created user's details. #### Response Example (Response body structure depends on the API, refer to Hyperwallet API documentation for specifics) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.