You can use a package in an npm or Python repository as a dependency for a Cloud Function.
Required permissions
Cloud Functions uses the Cloud Build service account in the same Google Cloud project to build and deploy your function.
- If Cloud Functions and Artifact Registry are in the same Google Cloud project, the service account has the necessary permissions to download from repositories.
- If Cloud Functions and Artifact Registry are in different projects, you must grant repository access to the Cloud Build service account.
Configuring access to dependencies
See the Cloud Functions documentation for npm and Python configuration instructions.