⚖

Consents

When you use the authentication function, the second parameter should be a callback function (this can also be an arrow function). This function will be called when legal documents have been updated in the FibriCheck cloud and the end-user needs to reapprove these. Example showing how to hook changes to legal documents change with your application and calling the giveConsent function with the document after the user has approved these.
Flutter
React Native
import 'package:flutter_fibricheck_sdk/flutter_fibricheck_sdk.dart';
​
_sdk.authenticateWithEmail(
ParamsOauth1WithEmail(
email: "",
password: "",
),
onConsentNeeded);
void onConsentNeeded(List<Consent> documentsToSign) {
for (var document in documentsToSign) {
{
// 1. Request approval from the user
​
// 2. Pass the document back to the sdk
_sdk.giveConsent(document);
}
}
}
import client from '@fibricheck/javascript-sdk';
​
const sdk = client({
consumerKey: '',
consumerSecret: '',
});
​
await sdk.authenticate(
{
password: '',
username: '',
},
(legalDocumentsUpdated) => {
/* Will return an array of objects with a key, version and url.
* ie.
* [{
* key: 'privacyPolicy',
* version: '1.5.0',
* url: 'https://fibricheck.com/privacyPolicy/150'
* }]
*/
​
legalDocumentsUpdated.forEach((document) => {
// 1. Request approval from the user
​
// 2. Pass the document back to the sdk
sdk.giveConsent(document);
});
},
);