> For the complete documentation index, see [llms.txt](https://docs.inji.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.inji.io/inji-wallet/inji-mobile/technical-overview/integration-guide/building-verifiable-credentials-wallet-with-inji-libraries/inji-vc-renderer-library.md).

# Inji VC Renderer Library

### Overview

Inji VC Renderer is a library designed to render Verifiable Credentials (VCs) by converting SVG templates into visual SVG images. The library dynamically replaces placeholders in SVG templates with actual Verifiable Credential JSON data, strictly following the JSON Pointer Algorithm (RFC6901) for value extraction.

**Key Responsibilities:**

* **VC Rendering Library**
  * Downloads SVG templates from the VC's render method
  * Replaces template placeholders with actual VC data
  * Supports multiple rendering methods and generates visual credential displays
  * Follows JSON Pointer Algorithm (RFC6901) for accurate data extraction
* **Library Consumer App**
  * Provides the Verifiable Credential data
  * Handles the display of credentials

### Supported Features

#### Core Capabilities

* **SVG Template Processing**: Downloads SVG templates from URLs specified in the VC render method
* **Dynamic Placeholder Replacement**: Replaces Mustache-style placeholders with actual VC data using JSON Pointer Algorithm (RFC6901)
* **VC Data Model 2.0 Support**: Compatible with the latest Verifiable Credential specification
* **QR Code Embedding**: Optionally embeds QR codes within SVG templates for credential verification

#### Supported Credential Formats

Currently supported credential format:

* **ldp\_vc** - Linked Data Proofs Verifiable Credentials

### Libraries Available In

Inji VC Renderer is available in Kotlin and Swift, supporting Android, JVM and iOS platforms.

* **Kotlin**: [Android (AAR) & JVM (JAR)](https://github.com/inji/inji-vc-renderer/tree/master/kotlin)
* **Swift**: [iOS](https://github.com/inji/inji-vc-renderer-ios-swift/tree/master)

#### Core Methods

The library provides a primary API for rendering credential display content:

**`generateCredentialDisplayContent()`**

Converts a Verifiable Credential into visual SVG representation by processing render methods and replacing template placeholders.

**Parameters:**

* `credentialFormat` - Enum specifying the credential format (currently supports `ldp_vc`)
* `vcJsonString` - The Verifiable Credential in stringified JSON format
* `wellKnownJson` (Optional) - Well-known metadata in stringified JSON format
* `qrCodeData` (Optional) - Custom data for QR code generation. If provided, QR code is generated using this value; if not provided or empty, the full VC JSON string is used as fallback. **Note**: `qrCodeData` should be pre-encoded (e.g., Base45-encoded)

**Returns:**

* List of rendered SVG templates as strings
* Multiple SVG templates are returned if multiple render methods are present in the VC

> **For comprehensive API documentation and detailed usage examples, refer to the respective repository documentation:**
>
> * [Kotlin/Java Repository](https://github.com/inji/inji-vc-renderer/tree/master/kotlin#api)
> * [Swift/iOS Repository](https://github.com/inji/inji-vc-renderer-ios-swift/tree/master#api)

#### Rendering Process Flow

The library follows these steps to render credential display content:

1. **Render Method Extraction** - Extracts render method information from the VC JSON
2. **SVG Template Download** - Downloads the SVG template from the URL specified in the render method
3. **Placeholder Replacement** - Uses JSON Pointer Algorithm (RFC6901) to extract values from VC JSON and replace placeholders in the SVG
4. **QR Code Generation** - Optionally generates and embeds a QR code (if `qrCodeData` is provided)
5. **Output Generation** - Returns the fully rendered SVG as a string

If multiple render methods exist in the VC, this process is repeated for each, and all rendered SVGs are returned as a list.

***

> Refer to the Inji Certify documentation for details on issuing credentials with SVG Rendering Support and the corresponding credential structure.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.inji.io/inji-wallet/inji-mobile/technical-overview/integration-guide/building-verifiable-credentials-wallet-with-inji-libraries/inji-vc-renderer-library.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
