Skip to content

Commit 1519eca

Browse files
committed
chore: update package name to @shadmanZero/tenantos-api, add GitHub Packages
1 parent 5456fde commit 1519eca

File tree

3 files changed

+58
-2
lines changed

3 files changed

+58
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ docs/*
2424
!docs/index.html
2525

2626
# Keep .github/docs for GitHub Pages
27-
!.github/
27+
!.github/
28+
.npmrc

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,26 @@ A modern, type-safe TypeScript/JavaScript client for the TenantOS API. Manage yo
1717

1818
## Quick start
1919

20+
### Install from npm (recommended)
21+
2022
```bash
2123
npm install tenantos-api
2224
```
2325

26+
### Install from GitHub Packages
27+
28+
If you prefer to install from GitHub Packages:
29+
30+
```bash
31+
# First, configure npm to use GitHub Packages for @shadmanZero scope
32+
echo "@shadmanZero:registry=https://npm.pkg.github.com" >> ~/.npmrc
33+
34+
# Then install the package
35+
npm install @shadmanZero/tenantos-api
36+
```
37+
38+
**Note**: When installing from GitHub Packages, you'll need to authenticate with a GitHub personal access token. See the [GitHub Packages Authentication](#github-packages-authentication) section below.
39+
2440
```typescript
2541
import { TenantosClient } from 'tenantos-api';
2642

@@ -237,6 +253,42 @@ try {
237253

238254
> ⚠️ **Security**: Never commit API keys to version control. Use environment variables or secure configuration management.
239255
256+
## GitHub Packages Authentication
257+
258+
If you're installing from GitHub Packages, you'll need to authenticate with a GitHub personal access token:
259+
260+
### 1. Create a Personal Access Token
261+
262+
1. Go to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
263+
2. Click "Generate new token (classic)"
264+
3. Select the `read:packages` scope (and `write:packages` if you plan to publish)
265+
4. Copy the generated token
266+
267+
### 2. Configure npm Authentication
268+
269+
**Option A: Using .npmrc file (recommended)**
270+
271+
```bash
272+
echo "//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN" >> ~/.npmrc
273+
```
274+
275+
**Option B: Using npm login**
276+
277+
```bash
278+
npm login --scope=@shadmanZero --auth-type=legacy --registry=https://npm.pkg.github.com
279+
# Username: your-github-username
280+
# Password: your-github-token
281+
282+
```
283+
284+
### 3. Install the Package
285+
286+
```bash
287+
npm install @shadmanZero/tenantos-api
288+
```
289+
290+
> 💡 **Tip**: You can use both npm and GitHub Packages versions simultaneously by importing from different package names.
291+
240292
## Complete example
241293

242294
Here's a real-world example that demonstrates multiple features:

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "tenantos-api",
2+
"name": "@shadmanZero/tenantos-api",
33
"version": "1.0.3",
44
"description": "Type-safe Node.js/TypeScript client for the TenantOS API.",
55
"main": "dist/index.js",
@@ -42,6 +42,9 @@
4242
"docs:api:html": "typedoc --options typedoc.html.json"
4343
},
4444
"license": "ISC",
45+
"publishConfig": {
46+
"registry": "https://npm.pkg.github.com"
47+
},
4548
"type": "commonjs",
4649
"sideEffects": false,
4750
"engines": {

0 commit comments

Comments
 (0)