Search Unity

Question Is it possible to download packages from my private GitHub repositories?

Discussion in 'Package Manager' started by JesseSTG, Mar 28, 2021.

  1. JesseSTG

    JesseSTG

    Joined:
    Jan 10, 2019
    Posts:
    236
    I have some packages that are not available on UPM registries but otherwise have a valid package.json manifest. To keep my project's source tree slim, I'd like to put these packages on a private GitHub repository and put the URL for that in my manifest.json. Is that possible? How would I authenticate, with a private key?
     
    ModLunar likes this.
  2. ehakan

    ehakan

    Joined:
    Jun 26, 2020
    Posts:
    3
    JesseSTG likes this.
  3. JesseSTG

    JesseSTG

    Joined:
    Jan 10, 2019
    Posts:
    236
    Thank you!

    Although I added the package to my manifest without that info and it just worked. Literally as if it were public. I think I previously configured my SSH private key or my GitHub credentials to allow this but then forgot about it, so I don't know why this works. This is convenient, but I'd like to be able to reproduce this.

    Why does this work? I'm using Windows 10.
     
  4. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    551
    Hi @JesseSTG,

    Have you looked at this section of the manual? https://docs.unity3d.com/Manual/upm-git.html#Git-SSH

    Encoding credentials in a URL works, but is unsecure. If you do that, you should avoid sharing the modified project with other people otherwise they'll be able to access your Git repo with your full repo permissions. Using an SSH key-based authentication is better and is supported by the Unity Package Manager.
     
    ModLunar and ehakan like this.
  5. JesseSTG

    JesseSTG

    Joined:
    Jan 10, 2019
    Posts:
    236
    Nice timing, we literally responded at the same time!
     
    ModLunar and maximeb_unity like this.