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:| Package | Description | npm Package Name |
|---|---|---|
| CLI | Command-line interface for project management | @native-desktop/cli |
| Config | Configuration management utilities | @native-desktop/config |
| Core | Core Native Desktop functionality | @native-desktop/core |
| React | React integration for Native Desktop | @native-desktop/react |
| App | Application runtime and utilities | @native-desktop/app |
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
- Visit Polar.sh Native Desktop (or your purchase portal)
- Select a plan that fits your needs
- Complete the purchase process
- 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
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click Generate new token → Generate new token (classic)
- 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
- ✅
- Note:
- Click Generate token
- Copy the token immediately - You won’t be able to see it again!
Example Token Permissions
Step 3: Configure npm Authentication
You need to configure npm to authenticate with GitHub Packages using your personal access token.Option A: User-Level Configuration (Recommended)
Configure authentication globally in your user.npmrc file:
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:
GITHUB_TOKEN environment variable:
Option C: Using npm login (Alternative)
You can also authenticate using thenpm login command:
- 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 yourpackage.json:
Installing Individual Packages
Step 5: Verify Installation
Verify that packages are installed correctly:Complete Setup Example
Here’s a complete example of setting up a new Native Desktop project:Troubleshooting
401 Unauthorized Error
401 Unauthorized Error
404 Package Not Found
404 Package Not Found
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
.npmrcincludes the registry configuration - Contact support if access issues persist
Token Expired
Token Expired
Error: Authentication fails after some timeSolution: Your personal access token may have expired. Create a new token:
- Go to GitHub Settings → Personal access tokens
- Delete the old token
- Create a new token with
read:packagesscope - Update your
.npmrcfile with the new token
.npmrc Not Found
.npmrc Not Found
Error: Cannot find
.npmrc fileSolution: Create the file manually:Permission Denied
Permission Denied
Error:
EACCES: permission deniedSolution: This usually happens with global installations. Try:No Access After Purchase
No Access After Purchase
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 tokenNODE_AUTH_TOKEN: Alias for GitHub token (some CI systems)