{"id":19510018,"url":"https://github.com/permify/permify-node","last_synced_at":"2025-08-17T21:39:39.585Z","repository":{"id":65083598,"uuid":"581342502","full_name":"Permify/permify-node","owner":"Permify","description":"Permify client for Node.js","archived":false,"fork":false,"pushed_at":"2025-08-08T10:53:47.000Z","size":2564,"stargazers_count":26,"open_issues_count":6,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-09T13:16:45.945Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Permify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-12-22T23:16:11.000Z","updated_at":"2025-08-03T22:01:03.000Z","dependencies_parsed_at":"2024-06-19T22:50:45.858Z","dependency_job_id":"ad2f4fc0-2d54-47aa-962b-e492e57f750b","html_url":"https://github.com/Permify/permify-node","commit_stats":{"total_commits":29,"total_committers":3,"mean_commits":9.666666666666666,"dds":0.1724137931034483,"last_synced_commit":"e5d34acbbc744168f195583e493b218015fa6de1"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/Permify/permify-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Permify%2Fpermify-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Permify%2Fpermify-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Permify%2Fpermify-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Permify%2Fpermify-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Permify","download_url":"https://codeload.github.com/Permify/permify-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Permify%2Fpermify-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270912541,"owners_count":24666746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"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-10T23:14:11.382Z","updated_at":"2025-08-17T21:39:39.558Z","avatar_url":"https://github.com/Permify.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/Permify/permify/raw/master/assets/logo-permify-dark.png\"\u003e\n    \u003cimg alt=\"Permify logo\" src=\"https://github.com/Permify/permify/raw/master/assets/logo-permify-light.png\" width=\"40%\"\u003e\n  \u003c/picture\u003e\n\u003c/div\u003e\n\u003ch1 align=\"center\"\u003e\n    Permify NodeJS Client\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/Permify/permify-node/releases\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/github/package-json/v/permify/permify-node?style=for-the-badge\" alt=\"GitHub package.json version\" /\u003e\u003c/a\u003e\u0026nbsp;\n    \u003ca href=\"https://github.com/Permify/permify-node?tab=readme-ov-file#Apache-2.0-1-ov-file\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/github/license/Permify/permify?style=for-the-badge\" alt=\"Permify Licence\" /\u003e\u003c/a\u003e\u0026nbsp;\n    \u003ca href=\"https://discord.gg/MJbUjwskdH\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/discord/950799928047833088?style=for-the-badge\u0026logo=discord\u0026label=DISCORD\" alt=\"Permify Discord Channel\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003c/p\u003e\n\nThis client makes it easy to interact with [Permify](https://github.com/Permify/permify) from your Node.js application.\n\n# Installation\n\nUse npm to install:\n\n```shell\nnpm install @permify/permify-node\n```\n\nUse yarn to install (Please be aware that Yarn versions greater than v1.10.0 and less than v2 are not supported):\n\n```shell\nyarn add @permify/permify-node\n```\n\n# How to use\n\n### Create a new tenant\n\n```typescript\nimport * as permify from \"@permify/permify-node\";\n\nconst client = permify.grpc.newClient({\n    endpoint: \"localhost:3478\",\n    cert: undefined,\n    insecure: true\n});\n\nclient.tenancy.create({\n    id: \"t1\",\n    name: \"Tenant 1\"\n}).then((response) =\u003e {\n    console.log(response);\n    // handle response\n})\n```\n\n### Write Schema\n\n```typescript\nimport * as permify from \"@permify/permify-node\";\n\nconst client = permify.grpc.newClient({\n    endpoint: \"localhost:3478\",\n    cert: undefined,\n    insecure: true\n});\n\nlet schema = `\n    entity user {}\n    \n    entity document {\n       relation viewer @user\n       \n       action view = viewer\n    }\n`;\n\n// Write the schema\nclient.tenancy.create({\n    tenantId: \"t1\",\n    schema: schema\n}).then((response) =\u003e {\n    // handle response\n})\n```\n\n### Write Relationships\n\n```typescript\nimport * as permify from \"@permify/permify-node\";\n\nconst client = permify.grpc.newClient({\n    endpoint: \"localhost:3478\",\n    cert: undefined,\n    insecure: true\n});\n\nclient.relationship.write({\n    tenantId: \"t1\",\n    metadata: {\n        schemaVersion: \"\"\n    },\n    tuples: [{\n        entity: {\n            type: \"document\",\n            id: \"1\"\n        },\n        relation: \"viewer\",\n        subject: {\n            type: \"user\",\n            id: \"1\"\n        }\n    }]\n}).then((response) =\u003e {\n    // handle response\n})\n```\n\n### Check\n\n```typescript\nimport * as permify from \"@permify/permify-node\";\n\nconst client = permify.grpc.newClient({\n    endpoint: \"localhost:3478\",\n    cert: undefined,\n    insecure: true\n});\n\nclient.permission.check({\n    tenantId: \"t1\",\n    metadata: {\n        snapToken: \"\",\n        schemaVersion: \"\",\n        depth: 20\n    },\n    entity: {\n        type: \"document\",\n        id: \"1\"\n    },\n    permission: \"view\",\n    subject: {\n        type: \"user\",\n        id: \"3\"\n    }\n}).then((response) =\u003e {\n    if (response.can === permify.grpc.base.CheckResult.CHECK_RESULT_ALLOWED) {\n        console.log(\"RESULT_ALLOWED\")\n    } else {\n        console.log(\"RESULT_DENIED\")\n    }\n})\n```\n\n### Streaming Calls\n\n```typescript\nimport * as permify from \"@permify/permify-node\";\n\nfunction main() {\n    const client = permify.grpc.newClient({\n        endpoint: \"localhost:3478\",\n        cert: undefined,\n        insecure: true\n    });\n\n    let res = client.permission.lookupEntityStream({\n        tenantId: \"t1\",\n        metadata: {\n            snapToken: \"\",\n            schemaVersion: \"\",\n            depth: 20\n        },\n        entityType: \"document\",\n        permission: \"view\",\n        subject: {\n            type: \"user\",\n            id: \"1\"\n        }\n    })\n\n    handle(res)\n}\n\nasync function handle(res: AsyncIterable\u003cpermify.grpc.payload.PermissionLookupEntityStreamResponse\u003e) {\n    for await (const response of res) {\n        // response.entityId\n    }\n}\n```\n\n### Interceptors\n\n#### Access Token Interceptor\n\n```typescript\nimport * as permify from \"@permify/permify-node\";\n\nconst client = new permify.grpc.newClient({\n    endpoint: \"localhost:3478\",\n    cert: undefined,\n    insecure: true\n}, permify.grpc.newAccessTokenInterceptor(\"YOUR_TOKEN\"))\n```\n\n### Certs\n\n```typescript\nimport * as permify from \"@permify/permify-node\";\nimport fs from 'fs';\n\nconst cert = fs.readFileSync('path/to/cert.pem');\n\nconst client = new permify.grpc.newClient({\n    endpoint: \"localhost:3478\",\n    cert: cert,\n    insecure: true\n}, permify.grpc.newAccessTokenInterceptor(\"YOUR_TOKEN\"))\n```\n\nPermify is an **open-source authorization service** for creating and maintaining fine-grained authorizations accross\nyour individual applications and services.\n\n* [Permify website](https://permify.co)\n* [Permify documentation](https://docs.permify.co/docs)\n* [Permify playground](https://play.permify.co)\n* [Permify GitHub Repository](https://github.com/Permify/permify)\n\n## Community \u0026 Support\n\nJoin our [Discord channel](https://discord.gg/MJbUjwskdH) for issues, feature requests, feedbacks or anything else. We\nlove to talk about authorization and access control :heart:\n\n\u003cp align=\"left\"\u003e\n\u003ca href=\"https://discord.gg/MJbUjwskdH\"\u003e\n \u003cimg height=\"70px\" width=\"70px\" alt=\"permify | Discord\" src=\"https://user-images.githubusercontent.com/39353278/187209316-3d01a799-c51b-4eaa-8f52-168047078a14.png\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://twitter.com/GetPermify\"\u003e\n  \u003cimg height=\"70px\" width=\"70px\" alt=\"permify | Twitter\" src=\"https://user-images.githubusercontent.com/39353278/187209323-23f14261-d406-420d-80eb-1aa707a71043.png\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://www.linkedin.com/company/permifyco\"\u003e\n  \u003cimg height=\"70px\" width=\"70px\" alt=\"permify | Linkedin\" src=\"https://user-images.githubusercontent.com/39353278/187209321-03293a24-6f63-4321-b362-b0fc89fdd879.png\" /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermify%2Fpermify-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpermify%2Fpermify-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermify%2Fpermify-node/lists"}