{"_id":"@dyad-org/supabase-management-js","name":"@dyad-org/supabase-management-js","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"@dyad-org/supabase-management-js","version":"1.0.1","description":"Convenience wrapper for the Supabase Management API","author":{"name":"Dustin Loring","email":"agent-cli-robot@gmail.com"},"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"},"repository":{"type":"git","url":"git+https://github.com/dyad-org/supabase-management-js.git"},"bugs":{"url":"https://github.com/dyad-org/supabase-management-js/issues"},"homepage":"https://github.com/dyad-org/supabase-management-js#readme","_id":"@dyad-org/supabase-management-js@1.0.1","gitHead":"1d1d099da61f4876a77d6d3b7a273a0352cc207f","_nodeVersion":"22.19.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-aRuEN7e6uW5rJBaj8X9ENj75P4vlImEwBdwpky5pQA1h6n3ZUGKdkp/dd9ROdxhEYuJG5pQouF66ExMzh883iQ==","shasum":"4bc7e183e0b1e30ab876477d632b413a0f0f7a55","tarball":"https://registry.npmjs.org/@dyad-org/supabase-management-js/-/supabase-management-js-1.0.1.tgz","fileCount":8,"unpackedSize":487770,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCID1LOU50w/+2QEY6RmkUFAyzTMxhBUK/ZwS2j8UXIvwXAiEA2NskHuf7BB8pElU+LBsI2qTpSX+q1GB6DFDSZSX0iPQ="}]},"_npmUser":{"name":"agent-cli-robot","email":"agent.cli.robot@gmail.com"},"directories":{},"maintainers":[{"name":"agent-cli-robot","email":"agent.cli.robot@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/supabase-management-js_1.0.1_1769525758830_0.036114057888748"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-27T14:55:58.722Z","1.0.1":"2026-01-27T14:55:58.981Z","modified":"2026-01-27T14:55:59.524Z"},"maintainers":[{"name":"agent-cli-robot","email":"agent.cli.robot@gmail.com"}],"description":"Convenience wrapper for the Supabase Management API","homepage":"https://github.com/dyad-org/supabase-management-js#readme","repository":{"type":"git","url":"git+https://github.com/dyad-org/supabase-management-js.git"},"author":{"name":"Dustin Loring","email":"agent-cli-robot@gmail.com"},"bugs":{"url":"https://github.com/dyad-org/supabase-management-js/issues"},"readme":"## 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 `supabase-management-js` in a Node.js project:\n\n```sh\nnpm install supabase-management-js\n```\n\n`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 \"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 \"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 \"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### Contributing\n\nContributions to this project are very welcome and greatly appreciated!\n\n1. Clone the repo into a public GitHub repo (or fork https://github.com/supabase-community/supabase-management-js/fork).\n\n2. Go to the project folder.\n\n```sh\ncd supabase-management-js\n```\n\n3. Install packages with `npm`:\n\n```sh\nnpm install\n```\n\n4. Make your changes\n\n5. Make sure types are correct\n\n```sh\nnpm run typecheck\n```\n\n6. Create a changeset to describe your changes if you are making changes to the source code that effects its public API\n\n```sh\nnpm exec changeset\n```\n\n7. Create a branch, commit your changes, and open a Pull Request against the `main` branch in this repo.\n\n### Regenerating types\n\nThe [v1.d.ts](./src/api/v1.d.ts) file is 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```\n","readmeFilename":"README.md","_rev":"1-3112ec8b131c9479c04dc556bf406726"}