> For the complete documentation index, see [llms.txt](https://integuru.gitbook.io/taiki-documentaion/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://integuru.gitbook.io/taiki-documentaion/quickstart.md).

# QuickStart

## 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.&#x20;

**Important:**&#x20;

* **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.**

<pre class="language-javascript"><code class="lang-javascript"><strong>const tokenResponse = await fetch("/initialize-token", {
</strong>    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
</code></pre>

## Step 2: Open Taiki Link

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

* &#x20;Initialize the Taiki CDK on your client:

```javascript
<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.

```javascript
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.&#x20;

<pre class="language-json"><code class="lang-json">POST /{YOUR_WEBHOOK_URL}
Content-Type: application/json

<strong>{
</strong>  "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
  }]
}
</code></pre>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://integuru.gitbook.io/taiki-documentaion/quickstart.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
