{"library":"permify-typescript","title":"Permify TypeScript Client","description":"permify-typescript is the official TypeScript client for Permify, an open-source authorization service designed for building fine-grained and scalable authorization systems. This package provides a programmatic interface to interact with the Permify API, covering operations for schema, relationships, permissions, and tenancy. As of version 1.6.9, the client's versioning now directly aligns with the upstream Permify API/OpenAPI version, ensuring closer synchronization with the service's capabilities. It is automatically generated by the OpenAPI Generator project, which ensures a consistent and up-to-date interface to the Permify API. The library supports Node.js environments version 18 and higher, shipping with full TypeScript type definitions for an enhanced developer experience.","language":"javascript","status":"active","last_verified":"Thu Apr 23","install":{"commands":["npm install permify-typescript"],"cli":null},"imports":["import * as permify from 'permify-typescript';","import { Configuration, TenancyApi, PermissionApi } from 'permify-typescript';","import type { Tenant } from 'permify-typescript';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import * as permify from \"permify-typescript\";\n\n// Configure the client with your Permify API base path and authorization token.\n// It's recommended to use environment variables for sensitive data.\nconst configuration = new permify.Configuration({\n    basePath: process.env.PERMIFY_API_BASE_PATH ?? \"http://localhost:3476\",\n    headers: {\n        'Authorization': process.env.PERMIFY_API_KEY ? `Bearer ${process.env.PERMIFY_API_KEY}` : \"\"\n    }\n});\n\n// Initialize the TenancyApi to interact with tenant-related endpoints.\nconst apiInstance = new permify.TenancyApi(configuration);\n\n// Define a tenant ID, perhaps from a database or a unique identifier.\nlet tenantId = \"example_tenant_id\"; \n\n// Create a new tenant in Permify.\napiInstance.tenantsCreate({\n    body: {\n        id: tenantId,\n        name: \"Example Tenant\"\n    }\n})\n.then((data) => {\n    console.log('API called successfully. Created tenant: ' + JSON.stringify(data.tenant));\n})\n.catch((error) => {\n    console.error('Error creating tenant:', error.response?.data || error.message);\n});","lang":"typescript","description":"This quickstart demonstrates how to initialize the Permify TypeScript client, configure it with a base path and an authorization header using environment variables, and then create a new tenant using the TenancyApi client.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}