{"id":13566745,"url":"https://github.com/MyDidCom/mydid-auth","last_synced_at":"2025-04-04T00:32:08.618Z","repository":{"id":40268941,"uuid":"420932611","full_name":"MyDidCom/mydid-auth","owner":"MyDidCom","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-24T16:40:03.000Z","size":398,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T17:46:03.400Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MyDidCom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-25T08:06:43.000Z","updated_at":"2025-03-24T16:40:06.000Z","dependencies_parsed_at":"2023-11-29T16:29:24.823Z","dependency_job_id":"ecf336a5-095b-4b29-8d24-b80563693711","html_url":"https://github.com/MyDidCom/mydid-auth","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MyDidCom%2Fmydid-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MyDidCom%2Fmydid-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MyDidCom%2Fmydid-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MyDidCom%2Fmydid-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MyDidCom","download_url":"https://codeload.github.com/MyDidCom/mydid-auth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247103290,"owners_count":20884023,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:02:15.804Z","updated_at":"2025-04-04T00:32:08.251Z","avatar_url":"https://github.com/MyDidCom.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# mydid-auth\n\n## Usage\n\nInstall package :\n\n```shell\nnpm i @mydidcom/mydid-auth\n```\n\nImport package :\n\n```javascript\nconst mydidAuth = require(\"@mydidcom/mydid-auth\");\n```\n\n\u003cbr/\u003e\u003cbr/\u003e\n**Initialize with provider and smart contract address :**\n\n_initialize: (config: object)_\n\n```javascript\ntry {\n  mydidAuth.initialize({\n    web3GivenProvider: \"https://data-seed-prebsc-1-s1.binance.org:8545/\",\n    smartContractAddress: \"0x6828adf1aED03be429eE42053a4F72CDd3c70846\",\n  });\n} catch (err) {\n  // Handle error\n  console.log(\"Error trying to initialize mydid-auth : \" + err);\n}\n```\n\n\u003e If module is not initialized, will used default value :\n\u003e\n\u003e - web3GivenProvider: 'https://data-seed-prebsc-1-s1.binance.org:8545/'\n\u003e - smartContractAddress: '0x6828adf1aED03be429eE42053a4F72CDd3c70846'\n\n\u003cbr/\u003e\u003cbr/\u003e\n**Create verifiable presentation request :**\n\n_createVPRequest: (challenge: string, domain: string, verifiableCredentials: string[])_\n\n```javascript\nconst VPRequest = mydidAuth.createVPRequest(\n  // Custom string for identifying challenge in database\n  \"6360c6acfe7951946f0532dcee1d314645312a4b5480d80646ff9241ce68892d\",\n  // Callback where will be sent verifiable presentation\n  \"https://mywebsite.com/api/v1/callback\",\n  // Verifiable credentials asked for authentication\n  [\"email\", \"nationality\"]\n);\n```\n\n\u003e If not verifiable credentials are needed, set verifiableCredentials to an empty array.\n\n\u003cbr/\u003e\u003cbr/\u003e\n**Validate consistency of verifiable presentation :**\n\n_validateVPConsistency: (VPData: object)_\n\n```javascript\ntry {\n  mydidAuth.validateVPConsistency(verifiablePresentation);\n} catch (err) {\n  // Handle error\n  console.log('Can't valid verifiable presentation consistency : ' + err);\n}\n```\n\n\u003cbr/\u003e\u003cbr/\u003e\n**Validate authenticity of verifiable presentation :**\n\n_validateVPAuthenticity: async (VPData: object)_\n\n```javascript\ntry {\n  await mydidAuth.validateVPAuthenticity(verifiablePresentation);\n} catch (err) {\n  // Handle error\n  console.log('Can't valid verifiable presentation authenticity : ' + err);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMyDidCom%2Fmydid-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMyDidCom%2Fmydid-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMyDidCom%2Fmydid-auth/lists"}