Netlify Deploy Token Needed for Private NPM Package

Hello and good day!

I kindly ask, can I please have an assistance in regards to getting a deploy token to be used for Private repo - NPM Package?

Thanks much in advance.

Hi, @tanhernandez, we have a community topic which explains that process here:

If there are any questions after reading that topic, please let us know.

Hi Luke,

Actually my NPM package is not connected to npmjs.org, but directly into our company gitlab. Do you have a guide for that as well?

This is my other post related to my query.

@tanhernandez, our documentation here says this:

To access private GitLab repositories directly from your package.json file, use GitLab access tokens.

Does GitLab documentation help to resolve this?

Thanks for your response, but my question is how should I get the deploy key in order to be used for pulling the Private repo NPM Packages? I’ve read in your docs that I should contact helpdesk in order to get the deploy keys for it.

@tanhernandez, which Netlify site is this for? We need to know the netlify.com subdomain or the site API ID to look that up. Please share whichever you prefer.

It is for dt-ct-v2-vue-cli.netlify.com, thanks much in advance @luke! :slight_smile:

Hi, @tanhernandez. The public key is:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4lVfQA7/d7jWnSFH9SOv67syEhLXyeNyfX2k2bs8ikIhJU53NwZYYRbrvJIntiXEg5uIVcmWl3wyOkqG0W51LGAa7bsJHi0g9KLfScUIDicUAkrAM+F4TsjRPUAFOtuqZErZcV2mw7KN41JSnhrA6wOxpo9EDloRwzLUKIRp94Z7q0Fd6Dxi9U+cLEW2mvb0uf8t0oWO27SO5hf5zJyP5Fu8VCU7EWEJgiTfcn3lBrPsfBNtN1+G/KjEbWSnT6u4oBKLzeWrNiAvnazU6742XclhVBjaVjx7vqtA/NFJJQGp6+MvGLDyXT9hLt50V042lWuYc5wVClGTSLpDociMB

Thanks much @luke! I’m gonna try this :slight_smile:

Hi @luke, I’ve tried the public key you provided. Is it the same deploy key of the netlify site? I’ve been already using this and it is working on the Private repo Main App, but not with the Private repo NPM Dependencies.

Can you describe how you are trying to pass the deploy key for your npm package?

Hi @Dennis, thanks for responding.

It’s the same manner as in my Main App private repo.

For each NPM package private repo, I did: Settings > Repository > Deploy Keys, and added the Netlify Deploy Key.
But since I’ve already been using the Netlify Deploy Key for the Main App (which belongs to the same group as the NPM Package repos) I simple enabled the Netlify Deploy Key for them instead of adding it again. Because adding it again will just tell “Fingerprint already taken”.

And then in my package.json of the Main App, I’m referencing the NPM package as
"@company/package-name": "git+ssh://git@gitlab.company.com:group/sub-group/package.git"

I hope that clarifies it.

Hi @Dennis , Good day, do you have further guidance in regards to my response above?

Hi,

It looks like that link is trying to get the package using an ssh key. The buildbot is not configured to use the deploy key as its ssh key, so things won’t work without more configuration. I think you’ll have to follow this post instead on how to get set up to access a private repository: [Common Issue] How do I access private repositories in the build environment?

@Dennis
Thanks much for your clarification about the matter, I’m gonna try the link you’ve sent.

Have a nice day!

1 Like

@Dennis

The “Deploy Token” approach helped and solved my problem. Thanks much for your assistance!

1 Like