Hello Humanity Server
In this section you will be creating your first server side integration app with humanity protocol capable of verifying any EIP-55 wallet address against the Humanity Protocol knowledge base through Humanity Protocol API.
You can find the code for this tutorial in the following repo. Remember to rename your .env.example to .env and to add your API key
Let’s first create the folder and basic structure of our project
Then let’s create our .env file with our HP_API_KEY, our HP_API_URL and the default PORT for our application
Create a package.json file at the root of your directory and add the following content
Install all the packages with npm i
Now let’s create an index.js file in the root of our directory and import the necessary packages at the top of the file
We will use express to speed up our node.js environment as well cors and node-fetch for cross origin API calls. We will also use swagger to provide docs and a minimal visual implementation to test out our server side application.
Let’s define the behavior and options for our application by including the following code
Bellow our existing code let’s now define our main API endpoint and the corresponding swagger configuration and schemas
And our health check to verify the server is up and knows where the API is
Finally let’s start the server with our PORT and HP_API_URL
Your index.js file should like this this
Go ahead and fire up the application by running npm run dev in your terminal. You should see something like this
You can now start testing your application in your browser by going to http://localhost:3002 annd adding any wallet address as param for the call to the /verify/ endpoint. Example:
You also have an UI via swagger by visiting http://localhost:3002/api-docs where you should the following screen.

To make a call to our /verify end point, expand the /verify/{walletAddress} option and click on Try it out

Change the default wallet address to any EIP-55 compliant address and click Execute

A new block under response will appear showing you the results of the call to Humanity Protocol API with response types and logs whether for successful or unsuccessful responses.

Congratulations, you have build your own API service connected to Humanity Protocol capable of validating any EIP-55 wallet address. Feel free to modify or expand this implementation to integrate your own service.
Next Steps
If you want to explore a client side integration to integrate your project into humanity protocol please visit our hello humanity client
You are now equipped to develop more sophisticated applications and incorporate Humanity Protocol into your existing systems. To facilitate this process, please visit our Developers Portal where you can access comprehensive resources to create innovative applications that ensure each user is a verified unique individual.
Last updated