> For the complete documentation index, see [llms.txt](https://docs.zkpass.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zkpass.org/developer-guides/js-sdk/schema.md).

# Schema

A schema comprises two primary components:

* API requests required based on verification conditions
* Grammar paths from the API responses for extracting the fields needed for verification
* Assertion for the verification

Here is a example regarding the TikTok:

The request looks like:

```bash
curl 'https://www.tiktok.com/passport/web/account/info/' \
  ......
  -H 'cookie: _tt...faf' \
  ......
  --compressed
```

The response looks like:

<pre class="language-json"><code class="lang-json"><strong>{
</strong>  "data": {
    "user_id": 7*****************7,
    "user_id_str": "7*****************7",
    "odin_user_type": 12,
    ...
    "create_time": 1690168843,
    ...
    "app_id": 1459,
    "is_employee": false,
    "external_employee_platform": ""
  },
  "message": "success"
}
</code></pre>

The verification involves checking whether the account creation date is prior to August 2023(timestamp is 1690848000000).

So the schema looks like:

```json
{
  "category": "Social",
  "issuer": "Tiktok",
  "desc": "TikTok is a video-sharing app that allows users to create and share short-form videos on any topic.",
  "website": "https://www.tiktok.com",
  "APIs": [
    {
      "host": "www.tiktok.com",
      "intercept": {
        "url": "passport/web/account/info/",
        "method": "GET"
      },
      "assert": [
        {
          "key": "data|create_time",
          "value": "1690848000",
          "operation": "<"
        }
      ],
      "nullifier": "data|user_id_str"
    }
  ],
  "tips": {
    "message": "When you successfully log in, please click the 'Start' button to initiate the verification process."
  }
}
```

::: info The `nullifier` is a required element in the schema, serving to indicate a unique identifier for the user in the data source. It is the witness and will be hashed with a random number generated by MPC in zk circuit to ensure the nullifier's value remains undisclosed to the validator. Developers can use the hash of nullifier to prevent Sybil attacks. :::

In [zkPass dev center](https://dev.zkpass.org), we have preset schemas for user to choose and config. Developers have the flexibility to design their own personalized schemas and seamlessly integrate them into their projects. Further details can be found in the [Custom Schema](/developer-guides/js-sdk/schema/custom-schema.md) section, providing comprehensive information on how to create and implement customized schemas for your specific needs.


---

# 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://docs.zkpass.org/developer-guides/js-sdk/schema.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.
