This package is distributed as a private GitHub package. Here are the different ways to install it:
# With yarn (recommended)
yarn add git+https://github.com/congdcit/web-sdk.git#main:packages/shared
# With npm
npm install git+https://github.com/congdcit/web-sdk.git#main:packages/shared
# With pnpm
pnpm add git+https://github.com/congdcit/web-sdk.git#main:packages/shared# Install specific tag version with yarn
yarn add git+https://github.com/congdcit/web-sdk.git#@web-sdk/shared@0.0.4:packages/shared
# Install specific tag version with npm
npm install git+https://github.com/congdcit/web-sdk.git#@web-sdk/shared@0.0.4:packages/shared# Install from a specific branch
yarn add git+https://github.com/congdcit/web-sdk.git#feature-branch:packages/shared
# Install from develop branch
yarn add git+https://github.com/congdcit/web-sdk.git#develop:packages/sharedAdd to your package.json:
{
"dependencies": {
"@web-sdk/shared": "git+https://github.com/congdcit/web-sdk.git#main:packages/shared"
}
}Or for a specific version:
{
"dependencies": {
"@web-sdk/shared": "git+https://github.com/congdcit/web-sdk.git#@web-sdk/shared@0.0.4:packages/shared"
}
}Then run:
yarn install
# or
npm installIf the repository is private, you'll need authentication:
# Using GitHub Personal Access Token
npm install git+https://<token>@github.com/congdcit/web-sdk.git#main:packages/shared
# Or configure git credentials
git config --global url."https://<token>@github.com/".insteadOf "https://github.com/"- Visit: https://github.com/congdcit/web-sdk/releases
- Find the desired release (e.g.,
@web-sdk/shared@0.0.4) - Download
web-sdk-shared-X.X.X-dist.tar.gz - Extract the tarball:
tar -xzf web-sdk-shared-0.0.4-dist.tar.gz
- Copy the
distfolder to your project
Once installed, you can import the package:
// ES Modules
import { someFunction } from '@web-sdk/shared';
import { utilityFunction } from '@web-sdk/shared/utils';
import { SOME_CONSTANT } from '@web-sdk/shared/constants';
// CommonJS (if supported)
const { someFunction } = require('@web-sdk/shared');The package includes TypeScript definitions in the dist folder:
- Main types:
./dist/index.d.ts - Utils types:
./dist/utils/index.d.ts - Constants types:
./dist/constants/index.d.ts
The package exports the following entry points:
- Main:
@web-sdk/shared→./dist/index.js - Utils:
@web-sdk/shared/utils→./dist/utils/index.js - Constants:
@web-sdk/shared/constants→./dist/constants/index.js
- Current Version: 0.0.4
- Repository: https://github.com/congdcit/web-sdk
- Package Path:
packages/shared
For private repositories, team members will need:
- GitHub Access: Permission to access the repository
- Git Authentication: Either:
- SSH keys configured with GitHub
- Personal Access Token with repo permissions
- GitHub CLI authentication (
gh auth login)
-
Authentication Error:
# Solution: Set up authentication gh auth login # Or use token in URL npm install git+https://<token>@github.com/congdcit/web-sdk.git#main:packages/shared
-
Package Not Found:
- Ensure you have access to the repository
- Check the package path is correct:
packages/shared - Verify the tag/branch exists
-
Build Issues:
- The package includes pre-built
distfolder - No additional build steps required after installation
- The package includes pre-built