{"id":18864,"library":"topaz-node","title":"Topaz Node SDK","description":"The official Node.js SDK for Topaz, a modern authorization service. Version 0.0.10 provides early-stage client bindings for managing users, roles, and permissions via the Topaz API. It ships with TypeScript definitions and supports both ESM and CommonJS. As a very early release (pre-1.0), the API is subject to rapid change. Key differentiators include native TypeScript support and a promise-based interface, but users should be cautious about stability and expect breaking changes between minor versions.","status":"active","version":"0.0.10","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install topaz-node","lang":"bash","label":"npm"},{"cmd":"yarn add topaz-node","lang":"bash","label":"yarn"},{"cmd":"pnpm add topaz-node","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export only; CJS users can use Topaz = require('topaz-node').default","wrong":"const Topaz = require('topaz-node')","symbol":"default","correct":"import Topaz from 'topaz-node'"},{"note":"Named export Topaz is available; default export is same object.","wrong":"import Topaz from 'topaz-node'","symbol":"Topaz","correct":"import { Topaz } from 'topaz-node'"},{"note":"User is a named type/class export.","wrong":"import User from 'topaz-node'","symbol":"User","correct":"import { User } from 'topaz-node'"},{"note":"TypeScript type for the client instance.","wrong":"","symbol":"TopazClient","correct":"import { TopazClient } from 'topaz-node'"}],"quickstart":{"code":"import Topaz, { User } from 'topaz-node';\nimport 'dotenv/config';\n\nconst client = new Topaz({\n  apiKey: process.env.TOPAZ_API_KEY ?? '',\n  baseUrl: process.env.TOPAZ_BASE_URL ?? 'https://api.topaz.sh'\n});\n\nasync function main() {\n  const user = await client.users.get('user123');\n  console.log(user.name);\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Initializes the Topaz client with environment variables and fetches a user by ID."},"warnings":[{"fix":"Pin to exact version and review changelog before upgrading.","message":"The SDK is pre-1.0 (v0.0.10) – expect frequent breaking changes between minor versions.","severity":"breaking","affected_versions":">=0.0.1 <1.0.0"},{"fix":"Use object parameter: client.users.create({ name: '...', email: '...' })","message":"The `createUser` method signature changed in v0.0.9; old signature with positional arguments is deprecated.","severity":"deprecated","affected_versions":"<0.0.9"},{"fix":"Use dynamic import or bundler that handles ESM.","message":"ESM-only environments (like Deno) require explicit import of 'topaz-node' due to missing CJS compat in some build outputs.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Do not use in browser; intended for Node.js only.","message":"The SDK uses `node-fetch` under the hood, which may cause issues in browser environments.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'-1.0':49 '0.0.10':15 'api':31,51 'author':12 'base':67 'bind':21 'break':78 'cautious':73 'chang':56,79 'client':20 'commonj':42 'definit':36 'differenti':58 'earli':18,46 'early-stag':17 'esm':40 'expect':77 'includ':59 'interfac':68 'javascript':83 'key':57 'manag':23 'minor':81 'modern':11 'nativ':60 'node':2 'node.js':6 'offici':5 'permiss':27 'pre':48 'promis':66 'promise-bas':65 'provid':16 'rapid':55 'releas':47 'role':25 'sdk':3,7 'servic':13 'ship':33 'stabil':75 'stage':19 'subject':53 'support':38,62 'topaz':1,9,30 'typescript':35,61,84 'user':24,70 'version':14,82 'via':28","created_at":"2026-04-25T07:40:32.270003+00:00","updated_at":"2026-04-25T07:40:32.270003+00:00","problems":[{"fix":"Run 'npm install topaz-node@0.0.10' and verify node_modules.","cause":"Package not installed or import path incorrect.","error":"Cannot find module 'topaz-node'"},{"fix":"Use: const Topaz = require('topaz-node').default;","cause":"Using default import in CJS without .default.","error":"Topaz is not a constructor"},{"fix":"Upgrade to v0.0.10: npm install topaz-node@0.0.10","cause":"Using older version before method was renamed.","error":"TypeError: client.users.get is not a function"},{"fix":"Set environment variable or pass apiKey option in constructor.","cause":"Missing or empty TOPAZ_API_KEY environment variable.","error":"Error: API key is required"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://www.topaz.sh","github":null,"docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/topaz-node","openapi_spec":null,"status_page":null,"smithery":null,"categories":["auth-security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}