{"id":29068601,"url":"https://github.com/mixinnetwork/bot-api-nodejs-client","last_synced_at":"2026-04-14T03:01:00.548Z","repository":{"id":37094396,"uuid":"395248187","full_name":"MixinNetwork/bot-api-nodejs-client","owner":"MixinNetwork","description":"Mixin API for JavaScript \u0026 Node.js","archived":false,"fork":false,"pushed_at":"2026-04-07T04:01:20.000Z","size":15537,"stargazers_count":16,"open_issues_count":12,"forks_count":12,"subscribers_count":7,"default_branch":"main","last_synced_at":"2026-04-07T06:06:28.167Z","etag":null,"topics":["nodejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MixinNetwork.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":"2021-08-12T08:25:25.000Z","updated_at":"2026-04-07T04:00:42.000Z","dependencies_parsed_at":"2022-07-14T04:10:29.067Z","dependency_job_id":"ddbb8d81-82f4-460d-b494-0e96ccbecb73","html_url":"https://github.com/MixinNetwork/bot-api-nodejs-client","commit_stats":{"total_commits":472,"total_committers":8,"mean_commits":59.0,"dds":0.7139830508474576,"last_synced_commit":"28bd6421fecf283a1a86402cfddbd3bed48b3fcc"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/MixinNetwork/bot-api-nodejs-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MixinNetwork%2Fbot-api-nodejs-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MixinNetwork%2Fbot-api-nodejs-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MixinNetwork%2Fbot-api-nodejs-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MixinNetwork%2Fbot-api-nodejs-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MixinNetwork","download_url":"https://codeload.github.com/MixinNetwork/bot-api-nodejs-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MixinNetwork%2Fbot-api-nodejs-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31779947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: 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":["nodejs"],"created_at":"2025-06-27T11:08:40.310Z","updated_at":"2026-04-14T03:01:00.517Z","avatar_url":"https://github.com/MixinNetwork.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bot-api-nodejs-client\n\nThe Node.js version of the mixin SDK [https://developers.mixin.one/docs/api-overview](https://developers.mixin.one/docs/api-overview)\n\n[中文版](./README.zh-CN.md)\n\n## New version features\n\n1. More friendly type and code hints\n2. More standardized function naming\n3. More comprehensive test coverage\n\n## Install\n\n```shell\nnpm install @mixin.dev/mixin-node-sdk\n```\n\nIf you use `yarn`\n\n```shell\nyarn add @mixin.dev/mixin-node-sdk\n```\n\n## Usage\n\n1. Use Mixin API\n\n```js\nconst { MixinApi } = require('@mixin.dev/mixin-node-sdk');\n\nconst keystore = {\n  app_id: '',\n  session_id: '',\n  server_public_key: '',\n  session_private_key: '',\n};\nconst client = MixinApi({ keystore });\n\n// Use Promise\nclient.user.profile().then(console.log);\n// Use async await\nasync function getMe() {\n  const me = await client.user.profile();\n  console.log(me);\n}\n```\n\n2. Receive Mixin Messenger messages\n\n```js\nconst { BlazeKeystoreClient } = require('@mixin.dev/mixin-node-sdk/blaze');\n\nconst keystore = {\n  app_id: '',\n  session_id: '',\n  server_public_key: '',\n  session_private_key: '',\n};\nconst config = {\n  parse: true,\n  syncAck: true,\n};\n\nconst client = BlazeKeystoreClient(keystore, config);\nclient.loop({\n  onMessage(msg) {\n    console.log(msg);\n  },\n});\n```\n\n3. OAuth\n\n```js\nconst { MixinApi, getED25519KeyPair, base64RawURLEncode } = require('@mixin.dev/mixin-node-sdk');\n\nconst code = ''; // from OAuth url\nconst app_id = ''; // app_id of your bot\nconst client_secret = ''; // OAuth Client Secret of your bot\n\nconst { seed, publicKey } = getED25519KeyPair(); // Generate random seed and ed25519 key pairs\n\nlet client = MixinApi();\nconst { scope, authorization_id } = await client.oauth.getToken({\n  client_id: app_id,\n  code,\n  ed25519: base64RawURLEncode(publicKey),\n  client_secret,\n});\nconst keystore = {\n  app_id,\n  scope,\n  authorization_id,\n  session_private_key: Buffer.from(seed).toString('hex'),\n};\nclient = MixinApi({ keystore });\nconst user = await client.user.profile();\n```\n\n## Use the sdk in web browser\n\nThis SDK uses node `Buffer`, which is not available in web browser. You can use polyfills to make it work.\n\nFor example, you can use `vite-plugin-node-polyfills` for vite.\n\n```js\n// vite.config.js\nimport { nodePolyfills } from 'vite-plugin-node-polyfills';\n// ...\nexport default defineConfig({\n  // ...\n  plugins: [\n    nodePolyfills({\n      globals: {\n        Buffer: true,\n      },\n    }),\n  ],\n});\n```\n\n## License\n\n```\nCopyright 2024 Mixin.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmixinnetwork%2Fbot-api-nodejs-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmixinnetwork%2Fbot-api-nodejs-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmixinnetwork%2Fbot-api-nodejs-client/lists"}