The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix: add docs for importing from private registries (#30298)
Lakshan Pererae5f3f4456e85
diff --git a/apps/docs/content/guides/functions/import-maps.mdx b/apps/docs/content/guides/functions/import-maps.mdxindex 858aa3d2f15..15e7bfdc9ab 100644--- a/apps/docs/content/guides/functions/import-maps.mdx+++ b/apps/docs/content/guides/functions/import-maps.mdx@@ -130,6 +130,31 @@ import process from 'node:process'Learn more about npm specifiers and Node built-in APIs in [Deno's documentation](https://docs.deno.com/runtime/manual/node/npm_specifiers).+### Importing from Private Registries++<Admonition type="info">++This feature requires Supabase CLI version 1.207.9 or higher.++</Admonition>++Create a `.npmrc` file within `supabase/functions`. This will allow you to import the private packages into multiple functions. Alternatively, you can place the `.npmrc` file directly inside `supabase/functions/function-name` directory.)++Add your registry details in the `.npmrc` file. Follow [this guide](https://docs.npmjs.com/cli/v10/configuring-npm/npmrc) to learn more about the syntax of npmrc files.++```+@myorg:registry=https://npm.registryhost.com+//npm.registryhost.com/:_authToken=VALID_AUTH_TOKEN+```++After that, you can import the package directly in your function code or add it to the import_map.json (/docs/guides/functions/import-maps#using-import-maps).++```ts+import MyPackage from 'npm:@myorg/[email protected]'++// use MyPackage+```+## Importing typesIf your [environment is set up properly](/docs/guides/functions/local-development) and the module you're importing is exporting types, the import will have types and autocompletion support.