A Web Application interacts with the Trust1Connector on standalone devices or within a shared environment. The Web Application is not aware, but must take this into consideration upon integration.
let environment = {
t1cApiUrl: 'https://t1c.t1t.io',
t1cApiPort: '51983',
t1cProxyUrl: 'https://t1c.t1t.io',
t1cProxyPort: '51983',
jwt: '' // retrieve via Back-end
};
const configoptions = new T1CSdk.T1CConfigOptions(
environment.t1cApiUrl,
environment.t1cApiPort,
environment.t1cProxyUrl,
environment.t1cProxyPort,
environment.jwt
);
config = new T1CSdk.T1CConfig(configoptions);T1CSdk.T1CClient.initialize(config).then(res => {
client = res;
console.log("Client config: ", client.localConfig);
core = client.core();
core.version().then(versionResult => console.log("T1C running on core "+ versionResult));
}, err => {
else if (err.code == 814501) {
$('#consentModal').modal('show', {
keyboard: false
});
$('.consent-token').text(makeid(20));
}
else if (err.code == 812020) {
$('.consent-token').text(makeid(20));
}
else if(err.code == 112999) {
document.querySelector("#initAlert").classList.remove("d-none")
document.querySelector("#initAlert").innerHTML = err.description;
} else {
console.error("T1C error:", err)
}
});core.readersCardAvailable().then(res => {
//Reader response
}, err => {
console.log("Cards available error:", err)
})function getBeid() {
if(selected_reader === null || selected_reader === undefined) return undefined
else return client.beid(selected_reader.id);
}const tokenNode = document.querySelector('.consent-token');
var range = document.createRange();
range.selectNode(tokenNode);
window.getSelection().addRange(range);
try {
// Now that we've selected the anchor text, execute the copy command
document.execCommand('copy');
} catch(err) {
console.log('Oops, unable to copy');
}
// Remove the selections - NOTE: Should use
// removeRange(range) when it is supported
window.getSelection().removeRange(range);
const clipboardData = tokenNode.textContent;