
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
A TypeScript implementation of the Digital Credentials Query Language (DCQL, pronounced [ˈdakl̩]) - a JSON-encoded query language for requesting and validating Verifiable Presentations.
DCQL enables Verifiers to request Verifiable Presentations that match specific queries. The library provides functionality to:
npm install dcql
# or
yarn add dcql
# or
pnpm add dcql
import { DcqlQuery, type DcqlCredential } from 'dcql'
const credentials = [
{
credential_format: 'mso_mdoc',
doctype: 'org.iso.7367.1.mVRC',
cryptographic_holder_binding: true,
namespaces: {
'org.iso.7367.1': {
vehicle_holder: 'John Doe',
},
'org.iso.18013.5.1': {
first_name: 'John',
},
},
authority: {
type: 'aki',
values: ['21cbb5a0-9d1e-46dc-b8aa-0e85036af442'],
},
},
] satisfies DcqlCredential[]
// Create a DCQL query
const query = {
credentials: [
{
id: 'my_credential',
format: 'mso_mdoc',
meta: { doctype_value: 'org.iso.7367.1.mVRC' },
claims: [
{
path: ['org.iso.7367.1', 'vehicle_holder'],
intent_to_retain: true,
},
{
path: ['org.iso.18013.5.1', 'first_name'],
},
],
},
],
} satisfies DcqlQuery.Input
// Parse (structural) and validate (content) the query
const parsedQuery = DcqlQuery.parse(query)
DcqlQuery.validate(parsedQuery)
// Execute the query against credentials
const queryResult = DcqlQuery.query(parsedQuery, credentials)
The query result provides detailed information about the match:
// Execute the query against credentials
const queryResult = DcqlQuery.query(parsedQuery, credentials)
// Check if query can be satisfied
console.log(queryResult.can_be_satisfied)
// Access matched credentials
console.log(queryResult.credential_matches)
// The result of a specific credential query
const credentialMatch = queryResult.credential_matches.credential_query_id
console.log(credentialMatch.success) // True if the query is fulfillable
Validate presentation results against queries:
const presentationQueryResult = DcqlPresentationResult.fromDcqlPresentation(
{
my_credential: [
{
credential_format: 'mso_mdoc',
doctype: 'org.iso.7367.1.mVRC',
namespaces: {
'org.iso.7367.1': { vehicle_holder: 'Martin Auer' },
'org.iso.18013.5.1': { first_name: 'Martin Auer' },
},
cryptographic_holder_binding: true,
},
],
},
{ dcqlQuery: parsedQuery }
)
FAQs
Digital Credentials Query Language (DCQL)
The npm package dcql receives a total of 13,818 weekly downloads. As such, dcql popularity was classified as popular.
We found that dcql demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.