meeting_place_credentials 0.0.1-dev.0
meeting_place_credentials: ^0.0.1-dev.0 copied to clipboard
Verifiable Relationship Credential (VRC), Relationship Card (R-Card), and liveness credential domain models, builders, and repository interfaces for the Meeting Place SDK.
example/README.md
meeting_place_credentials examples #
Check the sample code to learn how to use the Affinidi Meeting Place - Credentials SDK package to exchange R-Cards and Verifiable Relationship Credentials (VRCs) with peers over DIDComm v2.
| File path | What it demonstrates |
|---|---|
credentials/alice.dart |
Publishes a connection offer, approves Bob's request, sends an R-Card, initiates a VRC exchange, and reciprocates Bob's VRC. |
credentials/bob.dart |
Finds and accepts Alice's offer, sends an R-Card, and responds to Alice's VRC request. |
r_card/alice.dart |
Builds and signs a standalone R-Card VC using CredentialBuilder.buildRCard. Writes the blob for Bob to read. |
r_card/bob.dart |
Parses and inspects a received R-Card blob using RCardSubject.fromVcBlob. |
vrc/alice.dart |
Builds and signs a standalone VRC using CredentialBuilder.buildVrc. Writes the blob for Bob to read. |
vrc/bob.dart |
Parses Alice's VRC using VrcCredentialSubject.fromVcBlob and issues a reciprocal VRC. |
Running the Examples #
Execute the example Dart scripts from the packages/meeting_place_credentials/example folder. The wired examples (credentials/) require environment variables for CONTROL_PLANE_DID and MEDIATOR_DID. The examples use the dotenv package to load these values from a local .env file for convenience.
-
Create your local environment file
Run this command in your terminal to copy the template and create
.envin the root of theexamplefolder:cp templates/.example.env .envEdit
.envand update the values forCONTROL_PLANE_DIDandMEDIATOR_DIDto match your test environment. -
Run the example scripts
You can now run the examples directly using Dart:
# Wired credentials example (run in two separate terminals simultaneously) dart run credentials/alice.dart dart run credentials/bob.dartAlice writes a mnemonic to
.example-output/credentials-storage.txtand waits. Start Bob once Alice is waiting.# Standalone R-Card example (no live connection required) dart run r_card/alice.dart dart run r_card/bob.dart# Standalone VRC example (no live connection required) dart run vrc/alice.dart dart run vrc/bob.dartThe example utilities will automatically load variables from
.envin the root of the example folder.
Notes:
- The
.envfile should be placed in the root of the example folder as.env. - The template file is provided at
templates/.example.envfor convenience. - If
.envis missing, the code will fall back to environment variables from the platform (useful for CI or manual export). - The
r_card/andvrc/standalone examples do not require.env— they use an in-memory wallet and write output to.example-output/. - Scripts that produce files write them to
.example-output/(git-ignored). Run Alice before Bob in each pair.