Skip to content

Conversation

timcappalli
Copy link
Collaborator

@timcappalli timcappalli commented Sep 3, 2025

Closes #366 #365

This pull request enhances the documentation in index.html by adding guidance on feature and protocol support detection for the Digital Credentials API. It also updates the example code for requesting and issuing digital credentials to check for protocol support before proceeding, improving robustness and user experience.

Feature and protocol support detection:

  • Added a new section explaining how to check if the Digital Credentials API is supported in the user agent, including example code for feature detection.
  • Documented the use of the DigitalCredential.userAgentAllowsProtocol() static method to check if specific protocols are allowed, with examples for single and multiple protocols.

Example code improvements:

  • Updated the digital credential request and issuance examples to check for protocol support using userAgentAllowsProtocol() before making API calls, and to provide fallback methods if the protocol is not supported. [1] [2]
  • Refactored protocol usage in examples to use a protocol variable for clarity and consistency. [1] [2]
  • Improved comments and variable naming in the example code for better clarity, including specifying the verifier server and removing unnecessary formatting in JSON.stringify.

Preview | Diff

@timcappalli timcappalli requested a review from a team as a code owner September 3, 2025 20:33
Copilot

This comment was marked as outdated.

Co-authored-by: Marcos Cáceres <[email protected]>
Copilot

This comment was marked as outdated.

Co-authored-by: Copilot <[email protected]>
@marcoscaceres marcoscaceres changed the title Add feature and protocol detection examples Editorial: Add feature and protocol detection examples Sep 8, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive examples for feature detection and protocol checking to the Digital Credentials API documentation. It provides developers with practical guidance on how to detect API support and verify protocol availability before making API calls.

  • Adds feature detection examples showing how to check if the Digital Credentials API is supported
  • Introduces protocol checking examples using the userAgentAllowsProtocol() method for both single and multiple protocols
  • Updates existing credential request and issuance examples to include protocol validation and improved error handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@marcoscaceres
Copy link
Collaborator

marcoscaceres commented Sep 9, 2025

@timcappalli, mind having another look?

  • moved the feature detection check to be first.
  • removed the presence check on the static method - we should just assume the method is there, as it's not optional.

Copy link
Contributor

@MasterKale MasterKale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice examples 💪 I just had a couple of suggested changes, but nothing that should be considered blocking.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

index.html:1

  • There's a spelling error: 'Simliarly' should be 'Similarly'.
<!DOCTYPE html>

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@MasterKale MasterKale added the agenda+ Add to the weekly agenda label Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agenda+ Add to the weekly agenda editorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add feature detection example
4 participants