Git Product home page Git Product logo

iiw-demo's Introduction

Streetcred's API Quickstart

This demo shows how to add Streetcred API calls into a nodejs app with our service client. It also shows a webhook implementation can create automated workflows in your app.

Use Case

In this simple use case, you control a (very simple) issuer portal for your organization, which can issue a business card to anyone with a mobile wallet in your organization. Once a business card is issued, that holder can do business card verifications to other peers using the Streetcred mobile app.

Prerequisites:

Install mobile wallet

  1. Download the Android or iOS Streetcred Identity Wallet.

Steps to issue a business card:

Prepare issuer portal

  1. Clone the repository git clone https://github.com/streetcred-id/issuer-reference-app

  2. Navigate into the directory cd issuer-reference-app

  3. Install the dependencies npm install

  4. Open up the repository in a code editor of your choice

  5. Rename the .env-template file to .env

  6. Go to the Streetcred developer portal and create an account

Register your organization

  1. Create a new organization and select the Sovrin Staging Network.

  2. In the .env file, add your organization's subscription key to the SUBKEY field and the access token to the ACCESSTOK field.

Create a credential definition with Swaggerhub

  1. Retrieve your organization's Access Token and Subscription Key on the Organization page

    Organizations

  2. Navigate to the POST /definitions/credentials/{SchemaId} endpoint

  3. Click the lock button on the right-hand side of the endpoint description and authorize Swaggerhub by pasting "Bearer " + your access token in the accessToken field, your subscription key in the subscriptionKey field, and clicking authorize for each field

    • i.e. If the access token is 123456789, then enter it as Bearer 123456789
  4. Close the authorization modal, and click the Try it out button to prepare the API call to write the credential definition to the ledger

  5. In the .env file, find the ledger you're using and remove the # from before that SCHEMA_ID line

  6. Copy that schema ID into the schema_id field in Swaggerhub

    Organizations

  7. Click "execute" and after a couple seconds you will see "curl", "request URL", and "server response". Copy the definitionId value from the "server response" section and add it to your .env file for the CRED_DEF_ID value

    Organizations

  8. If you get a 504 Gateway Timeout error, go to the GET /definitions/credentials endpoint, click try it out and then execute to get your newly minted credential definition

Running the application

After defining the credential, you are ready to run the application.

  • Run with npm npm start

  • On the web app, fill in the details and click issue credential

    Organizations

  • If you're using the Streetcred Wallet, make sure your agent is configured to the Sovrin Staging network (upper-left on the home tab)

  • Scan the QR with your mobile wallet

    Organizations

This is a connection invitation. Webhooks will automatically issue you a credential once this is scanned

  • Accept the credential offer

  • Receive a business card!

  • If you are on iOS, you can also use the Streetcred Identity Agent to connect with others and send verified email and phone number between each other

Contact [email protected] for any questions.

iiw-demo's People

Contributors

b1conrad avatar bartcant avatar drakebw avatar drewchristofferson avatar mdbe avatar michaeldboyd avatar rileyhughes avatar tmarkovski avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.