Member-only story

How to Connect Blockstack to your Backend API

Part two of a three-part tutorial

Robert Chen
3 min readMay 20, 2019

In part one, How To Build Your First Blockchain App on Blockstack, I show you how to set up Blockstack login/signup. In this tutorial, we’ll connect the unique username that visitors create on Blockstack to your back end.

Prerequisites: Knowledge of setting up your own API will be required. We’ll also be using React.js for this tutorial.

While you would want to send private information such as phone numbers and addresses to Gaia Storage (a decentralized storage system), what I’m about to show you is useful for storing public information like comments or posts where you might want that information available on a public API.

Coming from part one of this three-part tutorial series, this is what App.js looked like:

We’re going to add two methods that’ll connect Blockstack to your API. Skip to step 6 if you only want to see the final code.

  1. We’ll be adding the following placeholders to your app’s state:

--

--

Responses (1)