{"id":21291908,"url":"https://github.com/idea2app/mobx-lark","last_synced_at":"2026-04-02T22:00:53.715Z","repository":{"id":42977643,"uuid":"470670876","full_name":"idea2app/MobX-Lark","owner":"idea2app","description":"Unofficial TypeScript SDK for FeiShu/Lark API","archived":false,"fork":false,"pushed_at":"2026-04-01T19:51:58.000Z","size":726,"stargazers_count":11,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-02T07:29:47.264Z","etag":null,"topics":["api","feishu","lark","sdk","typescript"],"latest_commit_sha":null,"homepage":"https://idea2app.github.io/MobX-Lark/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idea2app.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-03-16T16:45:19.000Z","updated_at":"2026-04-01T19:48:32.000Z","dependencies_parsed_at":"2024-11-21T17:16:05.690Z","dependency_job_id":"6d23d58b-3a0c-4d35-a16d-31e7ce88742a","html_url":"https://github.com/idea2app/MobX-Lark","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":"0.11764705882352944","last_synced_commit":"ac7fcfd92a773557ca6749b9703f6516aa7fe8cb"},"previous_names":["idea2app/lark-ts-sdk"],"tags_count":42,"template":false,"template_full_name":null,"purl":"pkg:github/idea2app/MobX-Lark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idea2app%2FMobX-Lark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idea2app%2FMobX-Lark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idea2app%2FMobX-Lark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idea2app%2FMobX-Lark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idea2app","download_url":"https://codeload.github.com/idea2app/MobX-Lark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idea2app%2FMobX-Lark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31317831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T21:35:00.834Z","status":"ssl_error","status_checked_at":"2026-04-02T21:34:59.806Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","feishu","lark","sdk","typescript"],"created_at":"2024-11-21T13:46:44.290Z","updated_at":"2026-04-02T22:00:53.707Z","avatar_url":"https://github.com/idea2app.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MobX-Lark\n\nUnofficial [TypeScript][1] SDK for [FeiShu/Lark API][2], which is based on [MobX-RESTful][3].\n\n[![MobX compatibility](https://img.shields.io/badge/Compatible-1?logo=mobx\u0026label=MobX%206%2F7)][4]\n[![NPM Dependency](https://img.shields.io/librariesio/github/idea2app/MobX-Lark.svg)][5]\n[![CI \u0026 CD](https://github.com/idea2app/MobX-Lark/actions/workflows/main.yml/badge.svg)][6]\n\n[![NPM](https://nodei.co/npm/mobx-lark.png?downloads=true\u0026downloadRank=true\u0026stars=true)][7]\n\n## Versions\n\n|   SemVer   |  branch  |    status    | ES decorator |    MobX     |\n| :--------: | :------: | :----------: | :----------: | :---------: |\n|   `\u003e=2`    |  `main`  | ✅developing |   stage-3    |  `\u003e=6.11`   |\n| `\u003e=0.8 \u003c2` |  `main`  | ❌deprecated |   stage-2    | `\u003e=4 \u003c6.11` |\n|   `\u003c0.8`   | `master` | ❌deprecated |              |             |\n\n## Usage\n\n- [Example](test/index.spec.ts)\n    - [SpreadSheet example](https://idea2app.feishu.cn/wiki/RQXiwdDvtiPz6HkokTqcVDZWnhg)\n    - [BI Table example](https://idea2app.feishu.cn/wiki/Jzqbwv4biiY1Ckkqf95cS97Ynig)\n- [API document](https://idea2app.github.io/MobX-Lark/)\n\n### 1. Initialize Lark app\n\n#### User access token (front-end)\n\n```ts\nimport { LarkApp } from 'mobx-lark';\nimport { parseCookie } from 'web-utility';\n\nconst { token } = parseCookie();\n\nexport const larkApp = new LarkApp({\n    id: process.env.LARK_APP_ID,\n    accessToken: token // or other getting way of OAuth token\n});\n```\n\n##### OAuth middleware for Next.js\n\n1. [Initialization](https://github.com/idea2app/Lark-Next-Bootstrap-ts/blob/afa51fad3b16e598bf3b10010b2dc47405b016a3/pages/api/Lark/core.ts#L40-L48)\n\n2. Page router usage:\n\n    ```ts\n    import { compose } from 'next-ssr-middleware';\n\n    import { larkOAuth2 } from '../utility/lark';\n\n    export const getServerSideProps = compose(larkOAuth2);\n    ```\n\n#### Tenant access token (back-end)\n\n```ts\nimport { LarkApp } from 'mobx-lark';\n\nexport const larkApp = new LarkApp({\n    id: process.env.LARK_APP_ID,\n    secret: process.env.LARK_APP_SECRET\n});\n```\n\n### 2. Define a model\n\nFor example, we use a BI Table as a database:\n\n```ts\nimport { BiDataQueryOptions, BiDataTable, TableCellValue } from 'mobx-lark';\n\nimport { larkClient } from '../utility/lark';\nimport { LarkBaseId } from '../configuration';\n\nexport type Client = Record\u003c\n    'id' | 'name' | 'type' | 'partnership' | 'image' | 'summary' | 'address',\n    TableCellValue\n\u003e;\n\nconst CLIENT_TABLE = process.env.NEXT_PUBLIC_CLIENT_TABLE!;\n\nexport class ClientModel extends BiDataTable\u003cClient\u003e() {\n    client = lark.client;\n\n    queryOptions: BiDataQueryOptions = { text_field_as_array: false };\n\n    constructor(appId = LarkBaseId, tableId = CLIENT_TABLE) {\n        super(appId, tableId);\n    }\n}\n```\n\n### 3. Query data\n\nUse Next.js page router for example:\n\n```tsx\nimport { FC } from 'react';\n\nimport { lark } from '../utility/lark';\nimport { Client, ClientModel } from '../models/Client';\n\nexport const getServerSideProps = async () =\u003e {\n    await lark.getAccessToken();\n\n    const clientStore = new ClientModel();\n\n    const fullList = await clientStore.getAll();\n\n    return { props: { fullList } };\n};\n\nconst ClientIndexPage: FC\u003c{ fullList: Client[] }\u003e = ({ fullList }) =\u003e (\n    \u003cmain\u003e\n        \u003ch1\u003eClient List\u003c/h1\u003e\n        \u003col\u003e\n            {fullList.map(({ id, name }) =\u003e (\n                \u003cli key={id}\u003e{name}\u003c/li\u003e\n            ))}\n        \u003c/ol\u003e\n    \u003c/main\u003e\n);\n\nexport default ClientIndexPage;\n```\n\n### 4. Render a document\n\n```ts\nimport { writeFile } from 'fs/promises';\nimport { DocumentModel, renderBlocks } from 'mobx-lark';\nimport { renderToStaticMarkup } from 'react-dom/server';\n\nimport { lark } from '../utility/lark';\n\nclass MyDocumentModel extends DocumentModel {\n    client = lark.client;\n}\nconst documentStore = new MyDocumentModel('idea2app.feishu.cn');\n\nconst blocks = await documentStore.getOneBlocks('a_docx_token');\n\nconst markup = renderToStaticMarkup(renderBlocks(blocks));\n\nawait writeFile('document.html', markup);\n```\n\n## Scaffolds\n\n1. https://github.com/idea2app/Lark-Next-Bootstrap-ts\n2. https://github.com/idea2app/Lark-Next-Shadcn-ts\n\n## User cases\n\n1. [idea2app web-site](https://github.com/idea2app/idea2app.github.io/tree/main/models)\n2. [Open-Source-Bazaar web-site](https://github.com/Open-Source-Bazaar/Open-Source-Bazaar.github.io/tree/main/models)\n\n## Related with\n\n- Lark client API: https://github.com/idea2app/Lark-client-API\n\n[1]: https://www.typescriptlang.org/\n[2]: https://open.feishu.cn/\n[3]: https://github.com/idea2app/MobX-RESTful\n[4]: https://mobx.js.org/\n[5]: https://libraries.io/npm/mobx-lark\n[6]: https://github.com/idea2app/MobX-Lark/actions/workflows/main.yml\n[7]: https://npm.im/mobx-lark/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidea2app%2Fmobx-lark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidea2app%2Fmobx-lark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidea2app%2Fmobx-lark/lists"}