Most modern frontend projects manage their dependencies using a package manager like npm or Yarn. To add our SDK to an existing project, the first thing you should do is install the necessary dependencies with the tool of your choice:
Using Yarn
yarn add @incodetech/incode-id-sdk
Using npm
npm install @incodetech/incode-id-sdk
To initialize the SDK, you need to provide your client id
import { create } from '@incodetech/incode-id-sdk';
// Get incode instance
const incodeID = create({
apiKey: 'sicretApiKey',
clientId: 'clientID',
logo: 'logoImage',
origin: 'originUrl',
});
This will return an instance of the SDK ready for use.
After you initialize the SDK, you can use any of the methods available (see API to learn more)
// Render iframe
incodeID.renderVerificationByIframe(container, {
width: 390,
height: 844,
onSuccess: onSuccess,
onError: onError,
});
Check our SDK API to learn more about it and how to use it. Click here to learn more.