Taiki Documentaion
  • Taiki API Overview
  • QuickStart
  • Detailed References
    • Initialize Token
    • Taiki Client SDK
Powered by GitBook
On this page
  • Step 1: Generate Access Token
  • Step 2: Open Taiki Link
  • Step 3: Receive Data

QuickStart

How to use Taiki

Step 1: Generate Access Token

Generate a temporary Access Token on your server which is used for secure connections between the Taiki Modal and Taiki servers. The access token expires in 1 hour.

Important:

  • This must be generated on your servers and sent to your frontend to the Taiki modal.

  • A new token must be generated every-time you open the Taiki Modal.

const tokenResponse = await fetch("/initialize-token", {
    method: 'POST', 
    headers: {
        'TAIKI-SECRET': {YOUR_SECRET_KEY},
        'TAIKI-USER-ID': {YOUR_SAVED_TAIKI_ID} //optional to use saved user credentials
    },
    body: JSON.stringify({ webhookURL: {YOUR_WEBHOOK_URL} })
})

const data = tokenResponse.json()
// For client to open Taiki Link Modal
const TEMPORARY_TOKEN = data.temporaryToken
// To associate the user's login credentials with a unique ID
const TAIKI_USER_ID = data.userId

Step 2: Open Taiki Link

Send the temporary token to the Taiki modal to initialize it.

  • Initialize the Taiki CDK on your client:

<script src="https://www.taiki.ai/link/link-initialize.js"></script> 
  • Initialize the Taiki modal. Users will be able to log-in and retrieve data within our modal.

const taikiModal = window.Taiki.create({
    token: TEMPORARY_TOKEN,
    metadata: {YOUR_METADATA},
    onSuccess: {YOUR_FUNCTION}
})

taikiModal.open() //to open the modal

Step 3: Receive Data

Upon successful data retrieval, Taiki servers will hit your provided webhook URL above. The payload looks like below. Taiki will retrieve all bank statements, and tax related documents such as various 1099s from the user's accounts. These documents will be accessible via a download URL.

Note: the download link expires within 15 minutes for security reasons.

POST /{YOUR_WEBHOOK_URL}
Content-Type: application/json

{
  "status": "success", 
  "data": {
    "id": 123, 
    "client_id": "a6f2f489-8cc9-4385-9649-efeabdfbe41b",
    "metadata": {YOUR_METADATA},
    "created_at": "2023-03-12T21:30:00Z" 
  },
  "files": [{ 
      "status": "success",
      "file_name": "1099_INT.pdf",
      "download_url": "example.com",
      "total_size_bytes": 9.34
  }]
}
PreviousTaiki API OverviewNextDetailed References