@dpa-id-components/dpa-id-token-service-client-javascript
v1.0.1
Published
Dpa id token service js client
Downloads
10
Maintainers
Keywords
Readme
dpa-id-token-service-client-javascript
Client module for supplying and revoking data with the token service
Installing the package from npm
Please run below command to add the package to your project.
npm install @dpa-id-components/dpa-id-token-service-client-javascript
Usage in code
Submit a token
The following is a basic example of submitting a token
const initializedClient = client.initialize({
ingestionQueueUrl: "ingestionQueueUrl",
revocationQueueUrl: "revocationQueueUrl"
})
initializedClient.submitToken("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", parseInt(new Date().getTime()/1000), parseInt(new Date().getTime()/1000), "dpa-select", "[email protected]")
.then(res => {
console.log("Response : ", res)
}).catch(err => {
console.log("ERROR : ", err)
})
Revoke a token
The following is a basic example of revoking a token
const initializedClient = client.initialize({
ingestionQueueUrl: "ingestionQueueUrl",
revocationQueueUrl: "revocationQueueUrl"
})
initializedClient.revokeToken("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")
.then(res => {
console.log("Response : ", res)
}).catch(err => {
console.log("ERROR : ", err)
})