{"id":17948824,"url":"https://github.com/eko/authz-nodejs-sdk","last_synced_at":"2026-05-05T07:31:57.174Z","repository":{"id":65469680,"uuid":"592947609","full_name":"eko/authz-nodejs-sdk","owner":"eko","description":"Authz NodeJS SDK","archived":false,"fork":false,"pushed_at":"2023-02-05T08:41:30.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-23T17:31:29.119Z","etag":null,"topics":["abac","authorization","nodejs","permissions","rbac"],"latest_commit_sha":null,"homepage":"https://authz.fr","language":"TypeScript","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/eko.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}},"created_at":"2023-01-24T21:48:59.000Z","updated_at":"2023-11-15T07:42:26.000Z","dependencies_parsed_at":"2023-02-14T02:01:42.617Z","dependency_job_id":null,"html_url":"https://github.com/eko/authz-nodejs-sdk","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/eko/authz-nodejs-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eko%2Fauthz-nodejs-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eko%2Fauthz-nodejs-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eko%2Fauthz-nodejs-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eko%2Fauthz-nodejs-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eko","download_url":"https://codeload.github.com/eko/authz-nodejs-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eko%2Fauthz-nodejs-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32640533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"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":["abac","authorization","nodejs","permissions","rbac"],"created_at":"2024-10-29T09:10:13.348Z","updated_at":"2026-05-05T07:31:57.157Z","avatar_url":"https://github.com/eko.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Authz NodeJS SDK\n\nThis is the Authz development kit for NodeJS.\n\n## Installation\n\nYou can install the SDK in your project by adding the following dependency:\n\n```bash\n$ npm install @eko/authz-sdk\n```\n\n## Usage\n\nYou have to instanciate a new Authz Client in your code by doing:\n\n```js\nimport { Client } from '@eko/authz-sdk';\n\nconst client = new Client('localhost:8081', '\u003cclient_id\u003e', '\u003cclient_secret\u003e');\n```\n\nOnce the client is instanciate, you have access to all the gRPC methods.\n\nIn order to create a new Principal, you can use\n\n```js\nconst response = await client.stub.principalCreate({\n    id: 'user-123',\n    attributes: [\n        {key: 'email', value: 'johndoe@acme.tld'},\n    ],\n});\n\nconsole.log('Principal created', response.principal?.id);\n```\n\nTo declare a new resource:\n\n```js\nconst response = await client.stub.resourceCreate({\n    id: 'post.123',\n    kind: 'post',\n    value: '123',\n    attributes: [\n        {key: 'owner_email', value: 'johndoe@acme.tld'},\n    ],\n});\n\nconsole.log('Resource created', response.resource?.id);\n```\n\nYou can also declare a new policy this way:\n\n```js\nconst response = client.stub.policyCreate({\n    id: 'post-owners',\n    resources: ['post.*'],\n    actions: ['edit', 'delete'],\n    attributeRules: [\n        'principal.email == resource.owner_email',\n    ],\n});\n\nconsole.log('Policy created', response.policy?.id);\n```\n\nThen, you can perform a check with:\n\n```js\nconst isAllowed = await client.isAllowed({\n    principal: 'user-123',\n    resourceKind: 'post',\n    resourceValue: '123',\n    action: 'edit',\n});\n```\n\nPlease note that you have access to all the gRPC methods [declared here](https://github.com/eko/authz/blob/master/backend/api/proto/api.proto) in the proto file.\n\n## Configuration\n\nThis SDK connects over gRPC to the backend service. Here are the available configuration options:\n\n| Property | Description |\n| -------- | ----------- |\n| Address | Authz backend to connect to |\n| ClientID | Your service account client id used to authenticate |\n| ClientSecret | Your service account client secret key used to authenticate |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feko%2Fauthz-nodejs-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feko%2Fauthz-nodejs-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feko%2Fauthz-nodejs-sdk/lists"}