Getting started

The Gini library provides ways to interact with the Gini API and therefore, adds the possiblity to scan documents and retrieve the extractions from them.

Initializing the library

To initialize the library, you just need to provide the API credentials:

    let sdk = GiniSDK
        .Builder(client: Client(id: "your-id",
                                secret: "your-secret",
                                domain: "your-domain"))
        .build()

Optionally if you want to use Certificate pinning, provide metadata for the upload process or use the Accounting API, you can pass both your public key pinning configuration (see TrustKit repo for more information), the metadata information and the API type (the Gini API is used by default) as follows:

    let sdk = GiniSDK
        .Builder(client: Client(id: "your-id",
                                secret: "your-secret",
                                domain: "your-domain"),
                 api: .accounting,
                 pinningConfig: yourPublicPinningConfig)
        .build()

⚠️ Important

  • The document metadata for the upload process is intended to be used for reporting.

Using the library

Now that the GiniSDK has been initialized, you can start using it. To do so, just get the Document service from it.

On one hand, if you choose to continue with the default Document service, you should use the DefaultDocumentService:

let documentService: DefaultDocumentService = sdk.documentService()

On the other hand, if you prefer to use the accounting Document service, just use the AccountingDocumentService as follows:

let documentService: AccountingDocumentService = sdk.documentService()

You are all set 🚀! You can start using the Gini API through the documentService.