{"_id":"@codeduet-sh/supabase-management-js","name":"@codeduet-sh/supabase-management-js","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@codeduet-sh/supabase-management-js","version":"1.0.0","description":"Convenience wrapper for the Supabase Management API","main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","publishConfig":{"access":"public"},"exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"scripts":{"clean":"rimraf dist","build":"npm run clean && npm run build:tsup","build:tsup":"tsup --dts-resolve","typecheck":"tsc --noEmit","generate":"openapi-typescript https://api.supabase.com/api/v1-json -o ./src/api/v1.d.ts","changeset:version":"changeset version","changeset:release":"npm run build && changeset publish"},"dependencies":{"openapi-fetch":"^0.6.1"},"devDependencies":{"@changesets/cli":"^2.26.2","@types/node":"18","esbuild":"^0.19.2","openapi-typescript":"^6.3.4","rimraf":"^3.0.2","tsup":"^8.0.1","tsx":"^4.6.2","typescript":"^4.8.4"},"engines":{"node":">=18.0.0"},"keywords":["supabase","management","api","codeduet"],"author":{"name":"CodeDuet"},"license":"Apache-2.0","_id":"@codeduet-sh/supabase-management-js@1.0.0","gitHead":"6198d883162dea33c545e6a9d50090cbc44986fb","_nodeVersion":"21.6.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-fP5ItQgn4S0laGLoHJX67ENdtfrgTR/fueytLcgH+Q53vTdR+mOH+Ksvivz6/GhsTauRmSJ+KMAa25DE3hbPxQ==","shasum":"6ecbdd03cf317700166f031f511f7367438b1501","tarball":"https://registry.npmjs.org/@codeduet-sh/supabase-management-js/-/supabase-management-js-1.0.0.tgz","fileCount":8,"unpackedSize":296109,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCXHSlmMd6rZ8Z9yCkqoCTxxtzlYBFCrEcEBX4XdSro9AIhAMXhUNipO9y4+a251h6CQ14zQ84mps6fW2Im4n8utNi+"}]},"_npmUser":{"name":"codeduet","email":"codeduet@gmail.com"},"directories":{},"maintainers":[{"name":"codeduet","email":"codeduet@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/supabase-management-js_1.0.0_1757952490138_0.13690521083720286"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-15T16:08:10.038Z","1.0.0":"2025-09-15T16:08:10.306Z","modified":"2025-09-15T16:08:10.676Z"},"maintainers":[{"name":"codeduet","email":"codeduet@gmail.com"}],"description":"Convenience wrapper for the Supabase Management API","keywords":["supabase","management","api","codeduet"],"author":{"name":"CodeDuet"},"license":"Apache-2.0","readme":"## @codeduet-sh/supabase-management-js\n\nA convenience wrapper for the [Supabase Management API](https://supabase.com/docs/reference/api/introduction) written in TypeScript.\n\n### Status\n\nThe Management API is in beta. It is usable in it's current state, but it's likely that there will be breaking changes.\n\n### Installation\n\nTo install `@codeduet-sh/supabase-management-js` in a Node.js project:\n\n```sh\nnpm install @codeduet-sh/supabase-management-js\n```\n\n`@codeduet-sh/supabase-management-js` requires Node.js 18 and above because it relies on the native `fetch` client.\n\n### Authentication\n\nYou can configure the `SupabaseManagementAPI` class with an access token, retrieved either through [OAuth](https://supabase.com/docs/guides/integrations/oauth-apps/authorize-an-oauth-app) or by generating an API token in your [account](https://supabase.com/dashboard/account/tokens) page. Your API tokens carry the same privileges as your user account, so be sure to keep it secret.\n\n```ts\nimport { SupabaseManagementAPI } from \"@codeduet-sh/supabase-management-js\";\n\nconst client = new SupabaseManagementAPI({ accessToken: \"<access token>\" });\n```\n\n### Usage\n\nThe `SupabaseManagementAPI` class exposes each API endpoint of the [Management API](https://supabase.com/docs/reference/api/introduction) as a function that returns a Promise with the corresponding response data type.\n\n```ts\nimport { SupabaseManagementAPI } from \"@codeduet-sh/supabase-management-js\";\n\nconst client = new SupabaseManagementAPI({ accessToken: \"<access token>\" });\n\nconst projects = await client.getProjects();\n\nif (projects) {\n  console.log(`Found ${projects.length} projects`);\n}\n```\n\n### Handling errors\n\nResponse errors are thrown as an instance of `SupabaseManagementAPIError` which is a subclass of `Error`. You can use the exported `isSupabaseError` guard function to narrow the type of an `unknown` error object:\n\n```ts\nimport { SupabaseManagementAPI, isSupabaseError } from \"@codeduet-sh/supabase-management-js\";\n\nconst client = new SupabaseManagementAPI({ accessToken: \"<access token>\" });\n\ntry {\n  await client.getProjects();\n} catch (error) {\n  if (isSupabaseError(error)) {\n    // error is now typed as SupabaseManagementAPI\n    console.log(\n      `Supabase Error:  ${error.message}, response status: ${error.response.status}`\n    );\n  }\n}\n```\n\n### Regenerating types\n\nThe types are auto-generated based on the Supabase [OpenAPI spec](https://api.supabase.com/api/v1-json) file with the following command:\n\n```sh\nnpm run generate\n```","readmeFilename":"README.md","_rev":"1-7ae11a942a28e3c1d0796e3238f4ba2d"}