Skip to main content

Overview

Native Desktop packages are distributed as private packages on GitHub via Polar.sh. When you purchase a Native Desktop license, you gain access to the private repository containing all packages based on your plan.

Available Packages

The Native Desktop ecosystem includes the following packages:
All packages are scoped under @native-desktop and hosted on GitHub Packages. You will receive read-only access to these packages after purchasing a license.

Prerequisites

Before installing Native Desktop packages, ensure you have:
  • Node.js version 16 or higher
  • npm version 7 or higher (or yarn 1.22+)
  • A GitHub account
  • A Native Desktop license (purchased via Polar.sh)
  • Access to the Native Desktop private repository

Step 1: Purchase a License

  1. Visit Polar.sh Native Desktop (or your purchase portal)
  2. Select a plan that fits your needs
  3. Complete the purchase process
  4. You will receive an email with repository access instructions
Repository access is granted automatically upon purchase. If you don’t receive access within a few minutes, contact support.

Step 2: Create a GitHub Personal Access Token

To install packages from GitHub Packages, you need to create a personal access token (classic) with the appropriate permissions.

Creating the Token

  1. Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
  2. Click Generate new tokenGenerate new token (classic)
  3. Configure the token:
    • Note: Native Desktop Packages (or any descriptive name)
    • Expiration: Choose an expiration period (90 days recommended)
    • Scopes: Select the following:
      • read:packages - Required to download packages
  4. Click Generate token
  5. Copy the token immediately - You won’t be able to see it again!
Treat your personal access token like a password. Never commit it to version control or share it publicly.

Example Token Permissions

Store your token securely in a password manager. You’ll need it for authentication.

Step 3: Configure npm Authentication

You need to configure npm to authenticate with GitHub Packages using your personal access token. Configure authentication globally in your user .npmrc file:
Add the following lines, replacing YOUR_GITHUB_TOKEN with your personal access token:
The ~/.npmrc file is located at:
  • macOS/Linux: ~/.npmrc
  • Windows: C:\Users\YourUsername\.npmrc

Option B: Project-Level Configuration

For project-specific configuration, create an .npmrc file in your project root:
Add the following content:
Then set the GITHUB_TOKEN environment variable:
If using project-level configuration, never commit .npmrc with your token to version control. Add it to .gitignore:

Option C: Using npm login (Alternative)

You can also authenticate using the npm login command:
When prompted:
  • Username: Your GitHub username
  • Password: Your personal access token (not your GitHub password!)
  • Email: Your public email address

Step 4: Install Packages

Once authentication is configured, you can install Native Desktop packages.

Installing the CLI Globally

Installing Packages in a Project

Add packages to your package.json:
Then install:

Installing Individual Packages

Step 5: Verify Installation

Verify that packages are installed correctly:
You should see version information for each installed package.

Complete Setup Example

Here’s a complete example of setting up a new Native Desktop project:

Troubleshooting

Error: npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/@native-desktop/cliSolutions:
  • Verify your personal access token is correct and not expired
  • Ensure the token has read:packages scope
  • Check that .npmrc is configured correctly
  • Confirm you have access to the Native Desktop repository
Error: npm ERR! 404 Not Found - GET https://npm.pkg.github.com/@native-desktop/cliSolutions:
  • Verify you have purchased a license and received repository access
  • Check the package name is correct (all lowercase, with scope)
  • Ensure .npmrc includes the registry configuration
  • Contact support if access issues persist
Error: Authentication fails after some timeSolution: Your personal access token may have expired. Create a new token:
  1. Go to GitHub Settings → Personal access tokens
  2. Delete the old token
  3. Create a new token with read:packages scope
  4. Update your .npmrc file with the new token
Error: Cannot find .npmrc fileSolution: Create the file manually:
Error: EACCES: permission deniedSolution: This usually happens with global installations. Try:
Error: Purchased license but still cannot access packagesSolution:
  • Wait a few minutes for access to be granted
  • Check your GitHub account’s email matches the purchase email
  • Verify you’re logged into the correct GitHub account
  • Contact Native Desktop support with your purchase details

Security Best Practices

Token Security

Never commit your personal access token to version control. Use environment variables or secure secret management.

Token Expiration

Set token expiration to 90 days or less and rotate regularly for better security.

Scope Limitation

Only grant read:packages scope - never use tokens with broader permissions.

Environment Variables

Use environment variables for tokens in CI/CD and project configurations.

CI/CD Configuration

GitHub Actions

GitLab CI

Environment Variables

For CI/CD, set these environment variables:
  • GITHUB_TOKEN: Your personal access token
  • NODE_AUTH_TOKEN: Alias for GitHub token (some CI systems)

Updating Packages

Update All Packages

Update to Specific Version

Uninstalling

Uninstall Global Packages

Uninstall Project Packages