{"id":20272343,"url":"https://github.com/steemit/auth-data","last_synced_at":"2026-07-02T10:32:41.817Z","repository":{"id":72308870,"uuid":"294267593","full_name":"steemit/auth-data","owner":"steemit","description":"This library is for the API to auth users' post data.","archived":false,"fork":false,"pushed_at":"2020-09-27T11:40:52.000Z","size":393,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-12-01T11:16:55.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/steemit.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}},"created_at":"2020-09-10T01:11:56.000Z","updated_at":"2021-09-29T17:06:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"32c86853-aa21-4577-82eb-aed5a0a6f8c7","html_url":"https://github.com/steemit/auth-data","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/steemit/auth-data","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steemit%2Fauth-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steemit%2Fauth-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steemit%2Fauth-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steemit%2Fauth-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steemit","download_url":"https://codeload.github.com/steemit/auth-data/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steemit%2Fauth-data/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35043933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-14T12:43:02.276Z","updated_at":"2026-07-02T10:32:41.795Z","avatar_url":"https://github.com/steemit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Auth Data SDK\n\nThis SDK is for the users who want to use steem user's private key to sign data to auth user identity without jsonrpc.\n\nIf you are using jsonrpc as your api protocol, you could refer to this SDK =\u003e [https://github.com/steemit/rpc-auth](https://github.com/steemit/rpc-auth) or this SDK =\u003e [https://github.com/steemit/koa-jsonrpc](https://github.com/steemit/koa-jsonrpc).\n\n## Usage\n\n### Sign Data\n\n```\nimport { signData } from '@steemfans/auth-data';\n\n// This is the data what you want to submit to server\nconst data = {\n    username: 'test',\n    avatar: '1.png',\n};\n\n// This is steem user's posting private key.\nconst privKeyOfTestUser = '5JP**********tH';\n\n// sign the data\nconst signedData = signData(data, privKeyOfTestUser);\n\n// submit the signedData\naxios.post(url, signedData);  \n```\n\n### Auth Signature\n\n```\nimport { authData } from '@steemfans/auth-data';\n\n// get the submited data\nconst data = JSON.parse(this.request.body);\n\n// get user's public key. the `getUserPublicKey` need be written by yourself.\nconst pubKey = yield getUserPublicKey(data.username, 'posting');\n\n// auth the data\nif (!authData(data, pubKey)) {\n    throw Error('the signature is incorrect.');\n}\n```\n\n### Other\n\nIf you want to use active key to sign data, you can add `auth_type` to the `data`\nto point which key you are using.\n\n```\nimport { signData } from '@steemfans/auth-data';\n\n// This is the data what you want to submit to server\nconst data = {\n    username: 'test',\n    avatar: '1.png',\n    auth_key: 'active',\n};\n\n// This is steem user's active private key.\nconst privKeyOfTestUser = '5JP**********tH';\n\n// sign the data\nconst signedData = signData(data, privKeyOfTestUser);\n\n// submit the signedData\naxios.post(url, signedData);  \n```\n\n```\nimport { authData } from '@steemfans/auth-data';\n\n// get the submited data\nconst data = JSON.parse(this.request.body);\n\n// get user's public key. the `getUserPublicKey` need be written by yourself.\nconst pubKey = yield getUserPublicKey(data.username, data.auth_key);\n\n// auth the data\nif (!authData(data, pubKey)) {\n    throw Error('the signature is incorrect.');\n}\n```\n\n## Issues\n\nIf you have any issue, please be easy to submit on [the issue page](https://github.com/steemfans/auth-data/issues).\n\n## Vote\n\nI'm also a witness [@ety001](https://steemit.com/@ety001). \nThank you for [voting me](https://steemlogin.com/sign/account-witness-vote?witness=ety001\u0026approve=1).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteemit%2Fauth-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteemit%2Fauth-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteemit%2Fauth-data/lists"}