@tradle/onfido-api

    1.0.0 • Public • Published

    onfido api + repl

    Promise-based Onfido API + cli/repl

    cli / repl

    ONFIDO_API_KEY=<your_api_key> ./cli.js
    applicants.list()
    //...
    applicants.create()
    //...
    applicants.uploadDocument('c7aff007-4b37-4c8a-81a5-13e46e5252a4', { filepath: './samples/license.jpg', type:'driving_licence' })
    //...
    checks.createDocumentCheck('c7aff007-4b37-4c8a-81a5-13e46e5252a4')

    API

    // token is same as ONFIDO_API_KEY above
    const onfido = new Onfido({ token })

    applicants

    • list()
    • get(applicantId)
    • create(applicantData)
    • update(applicantId, applicantData)
    • uploadDocument(applicantId, { type, ?side, ?file, ?filename, ?filepath })
    • uploadLivePhoto(applicantId, { type, ...fileOpts })
    • listDocuments()

    *fileOpts:

    • file: Buffer
    • filename: String
    • filepath: String

    *acceptable fileOpts: file + filename || filepath + filename || filepath

    checks

    • list({ applicantId, ?expandReports })
    • get({ checkId, applicantId })
    • create(applicantId, checkOpts)
    • createDocumentCheck(applicantId)
    • createFaceCheck(applicantId)

    reports

    • list({ checkId })
    • get({ checkId, reportId })
    • resume({ checkId, reportId })
    • cancel({ checkId, reportId })

    reportTypeGroups

    • list()
    • get(id)

    webhooks

    • list()
    • get(id)
    • register({ url, events })
    • unregister(url)
    • handleEvent(req) - resolves with event body if HMAC is good

    Install

    npm i @tradle/onfido-api

    DownloadsWeekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • leichtgewicht
    • genevayngrib
    • tenaciousmv
    • pgmemk