https://github.com/kiva/protocol-sdk-issuer
https://github.com/kiva/protocol-sdk-issuer
credential kiva-protocol protocol sdk ssi web-sdk
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kiva/protocol-sdk-issuer
- Owner: kiva
- License: apache-2.0
- Created: 2020-10-10T14:29:40.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-11T04:36:47.000Z (over 3 years ago)
- Last Synced: 2024-04-13T09:17:38.242Z (about 2 years ago)
- Topics: credential, kiva-protocol, protocol, sdk, ssi, web-sdk
- Language: TypeScript
- Homepage:
- Size: 1.99 MB
- Stars: 0
- Watchers: 9
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Protocol Issuer
Web SDK to embed SSI credential issuance capabilities in existing applications.

# Microfrontend application
This module can be embedded as an iframe into your existing application to issue credentials out of the box or used as a standalone credential issuance tool.
## Before You Start
This SDK is designed to be flexible enough to accommodate either an Aries agent running locally on your machine, or a cloud agent. If you already have one of these set up, you can skip this section, but if you don't and would still like to try out the platform, keep reading.
An easy option for making the SDK work out of the box is to set up the Kiva Aries backend locally. You'll need to [install Docker](https://docs.docker.com/get-docker/), but otherwise you should [be able to follow the steps in our `protocol-demo` repo to get an agent running quickly](https://github.com/kiva/protocol-demo#working-with-protocol-using-aries).
## Setting up your config file
This SDK relies on a configuration file (you can read more about why that's the case, and how the file is used, [here](https://github.com/kiva/protocol-sdk-issuer/tree/master/config)), and for convenience's sake we've created a [sample config that you can use to get started right away](https://github.com/kiva/protocol-sdk-issuer/tree/master/config/get_started.json).
There's plenty of stuff you can do to customize your UI using the config, which you can read about [here](https://github.com/kiva/protocol-sdk-issuer/tree/master/config), but here are the important points for getting started.
1. Modify `controllerUrlBase` to use the base URL for whatever endpoint you're using for a Cloud agent. By default, we are using `http://localhost:3014`, because that's the default port that the Kiva cloud agent uses when you're using the backend locally.
2. If you are running a local agent on your machine, you can instead modify the `agent_port` config to point to the localhost port where your agent is running.
## Getting Started
Ok, at last: How do you actually run this?
First step is to install the NPM dependencies, which you can do from the root directory of this repo by running:
```
npm install
```
If you plan on contributing to this repo, we ask that you set up the Git hook scripts included in the `./hooks` directory in your local environment. This can be done by running:
```
npm run initHooks
```
Once that's done, you can build and serve a development version of the application using the `get_started` config file by running:
```
npm run start
```
Please note that, while the `run start` command uses `get_started.json` by default, you can easily change the configuration file you're using by running the following.
```
export CONF_FILE=path/to/your/config.json
```
To create an optimized build package, we recommend you run the following command.
```
npm run build
```
To serve the package locally, you can run
```
serve -s build
```
## Creating a Production Bundle for Deployment
This SDK is designed to support multiple deployments using just one codebase, with environment-specific variables [provided by a configuration file](https://github.com/kiva/protocol-sdk-issuer/tree/master/config).
To run a deployment for a specific configuration file, you can run this command from the root directory of this repo.
```
sh ./tools/bundle/create_bundle.sh
```
This will create a production bundle using `react-scripts` and will populate variables using the file specified by ``.
Configuration files also support custom environments, though at the moment we only support environments with the following names: `dev`, `qa`, `sandbox` and `prod`. (We are currently working on making this support less restrictive.)
In order to build a bundle for a specific environment, you can run this command.
```
sh ./tools/bundle/create_bundle.sh --
```
If no environment is specified, the default is `qa`.