Affinidi VS Code Extension and Affinidi CLI for Privacy-Preserving Applications — A Getting Started Guide

Affinidi Pte. Ltd.
3 min readDec 9, 2022

Affinidi’s vision is to empower communities with control and ownership of their data, creating new business models and greater trust.

As the customer demand for control and ownership of data continues to grow, it is becoming increasingly important for developers to better manage data privacy and portability within their apps. With our tooling, you can start creating a privacy-preserving app within minutes.

What Are Privacy-Preserving Apps?

Privacy-preserving apps make it easy to give your customers more control over how their information is used and shared. We enable this data ownership and control through Decentralized Identifiers (DIDs) and Verifiable Credentials (VCs).

Learn more about VCs, trust triangle, Decentralized Identifiers (DIDs), and selective disclosure.

What Are the Affinidi VS Code Extension and the Affinidi CLI?

The Affinidi VS Code Extension provides access to Affinidi’s developer tools directly within the Visual Studio Code editor’s command palette. This extension is a one-stop place for Affinidi’s developer tools that enables you to build privacy-preserving applications, without having to leave your IDE.

The Affinidi Command Line Interface (CLI) provides access to Affinidi Developer Tools through your terminal or shell. You can leverage this tool to create a project, manage your API keys, access schemas, and more through commands and scripts.

You should update both tools regularly to benefit from our continuous additions and latest improvements.

Getting Started

We assume that you already have VS Code installed (if not, head over here). You can either get the Affinidi VS Code extension through VS Code’s sidebar or you can go to the extension page on the VS Code Marketplace.

First, you need to create an Affinidi account and a project.

To do that, click on Affinidi logo in sidebar, then click on “Create an account with Affinidi”, enter your email and the OTP code that you received in your inbox.

When you’re authenticated, just click on “Create project” button and enter a project’s name. That’s it!

We’ll automatically create a digital identity for you — your personal DID.

If you want an end-to-end example of an application, that uses Affinidi APIs, you can generate a reference app directly from the extension.

The reference app includes such features as: issuing a credential, claiming & storing it in your wallet, verifying it.

This feature requires the Affinidi CLI to be installed:

$ npm i -g @affinidi/cli

The Affinidi Reference App

These tools will allow you to generate the Affinidi Reference App with the click of a button. The app is actually three applications in one. It provides three independent user flows for issuing, claiming/holding VCs, and verifying VCs, all housed in the same code base, to facilitate developer experience. In a real world scenario, the three flows would never coincide in the same application but as a developer you may need to build simultaneously for the three corners of the trust triangle: issuer, holder and verifier.

The Reference App is tailored for a certification and verification use case, but the Holder and Verifier flows can be extended to other use cases.

Find out more about our tools here:

We hope the above use case encourages you to build your own privacy-preserving applications. If you have any questions or issues, reach out to us on Discord. Also, if you have an idea and need help developing it, contact Marco Podien, our Dev Evangelist.

We can’t wait to see what you’ll build with the Affinidi VS Code Extension and the Affinidi CLI.

Please drop us some quick feedback here and help us shape the future of privacy-preserving applications.

--

--

Affinidi Pte. Ltd.

Reclaim your data, Reclaim your Identity, Reclaim Yourself