@inrupt/solid-client-vc
    Preparing search index...

    Function query

    • Send a Verifiable Presentation Request to a query endpoint in order to retrieve all Verifiable Credentials matching the query, wrapped in a single Presentation.

      Parameters

      Returns Promise<MinimalPresentation>

      The resulting Verifiable Presentation wrapping all the Credentials matching the query.

      a reason to the request is helpful when interacting with a user. The resulting Verifiable Presentation will wrap zero or more Verifiable Credentials.

      const verifiablePresentation = await query(
      "https://example.org/query", {
      query: [{
      type: "QueryByExample",
      credentialQuery: [
      {
      reason: "Some reason",
      example: {
      type: ["SomeCredentialType"],
      },
      },
      ],
      }]
      },
      { fetch: session.fetch }
      );

      This function will be removed in future versions. No replacement is planned.

    • Parameters

      • queryEndpoint: string
      • vpRequest: VerifiablePresentationRequest
      • Optionaloptions: ParseOptions & {
            fetch?: {
                (input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
                (input: string | Request | URL, init?: RequestInit): Promise<Response>;
            };
            normalize?: (vc: VerifiableCredentialBase) => VerifiableCredentialBase;
            returnLegacyJsonld?: true;
        }
        • Optionalfetch?: {
              (input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
              (input: string | Request | URL, init?: RequestInit): Promise<Response>;
          }
        • Optionalnormalize?: (vc: VerifiableCredentialBase) => VerifiableCredentialBase
        • OptionalreturnLegacyJsonld?: true

      Returns Promise<ParsedVerifiablePresentation>

      Use RDFJS API instead of relying on the JSON structure by setting returnLegacyJsonld to false

    • Parameters

      • queryEndpoint: string
      • vpRequest: VerifiablePresentationRequest
      • Optionaloptions: ParseOptions & {
            fetch?: {
                (input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
                (input: string | Request | URL, init?: RequestInit): Promise<Response>;
            };
            normalize?: (vc: VerifiableCredentialBase) => VerifiableCredentialBase;
            returnLegacyJsonld?: boolean;
        }
        • Optionalfetch?: {
              (input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
              (input: string | Request | URL, init?: RequestInit): Promise<Response>;
          }
        • Optionalnormalize?: (vc: VerifiableCredentialBase) => VerifiableCredentialBase
        • OptionalreturnLegacyJsonld?: boolean

      Returns Promise<ParsedVerifiablePresentation | MinimalPresentation>

      Use RDFJS API instead of relying on the JSON structure by setting returnLegacyJsonld to false