callpad-sdk
v0.1.0
Published
A Turborepo monorepo containing the CallPad Web SDK and related packages.
Readme
CallPad Web SDK
A Turborepo monorepo containing the CallPad Web SDK and related packages.
Project Structure
This monorepo includes the following packages:
Packages
packages/sdk- CallPad SDK (vg-callpad-x07df) - Production-ready headless SDK for CallPad audio/video callsexamples/demo- Demo application showcasing CallPad SDK features
Tools & Configuration
- Turborepo for build orchestration and monorepo management
- pnpm as the package manager
- TypeScript for type checking
- Biome for code linting and formatting
- Changesets for version management and publishing
Getting Started
Prerequisites
- Node.js ≥18
- pnpm ≥9.0.0
Installation
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run type checking
pnpm check-types
# Run linting
pnpm lintDevelopment
# Start development mode
pnpm dev
# Start development for SDK only
pnpm dev --filter=vg-callpad-x07df
# Start demo application
pnpm dev --filter=callpad-demoBuilding
# Build all packages
pnpm build
# Build SDK only
pnpm build --filter=vg-callpad-x07df
# Build with type checking
pnpm build && pnpm check-typesPublishing Packages
This project uses Changesets for version management and publishing. The main publishable package is the CallPad SDK (vg-callpad-x07df).
Prerequisites for Publishing
NPM Authentication: Ensure you have npm access and authentication configured
npm login # or set NPM_TOKEN in your .env fileEnvironment Setup: Create a
.envfile in the root with your npm token:NPM_TOKEN=your_npm_token_here
Publishing Workflow
1. Create a Changeset
When you make changes that should be included in the next release, create a changeset:
# Create a new changeset (interactive)
pnpm changesetThis will:
- Prompt you to select which packages to include
- Ask for the type of change (major, minor, patch)
- Request a summary of the changes
2. Version Packages
When you're ready to release, update package versions based on changesets:
# Process changesets and bump versions
pnpm versionThis will:
- Update package.json versions according to changesets
- Update CHANGELOG.md files
- Remove processed changeset files
3. Publish to npm
Publish the updated packages:
# Build, type-check, and publish to npm
pnpm publish
# Or test the publishing process first
pnpm publish:dryThis command:
- Builds only the SDK package (
--filter=vg-callpad-x07df) - Runs type checking to ensure code quality
- Publishes to npm registry with proper authentication
Changeset Types
- Patch (
1.0.0 → 1.0.1): Bug fixes, small updates - Minor (
1.0.0 → 1.1.0): New features, backward-compatible changes - Major (
1.0.0 → 2.0.0): Breaking changes
Example Publishing Flow
# 1. Make your changes to the SDK
# 2. Create a changeset
pnpm changeset
# Select packages: vg-callpad-x07df
# Change type: patch/minor/major
# Summary: "Add new useCallQuality hook"
# 3. Commit your changes
git add .
git commit -m "feat: add useCallQuality hook"
# 4. When ready to release, process changesets
pnpm version
# 5. Publish to npm
pnpm publish
# 6. Push the version changes
git push && git push --tagsCI/CD Publishing
The Azure pipeline (.azure-pipelines/publish.yml) automatically publishes when:
- Changes are pushed to the
mainbranch - The
NPM_TOKENenvironment variable is configured in Azure DevOps
Remote Caching
[!TIP] Vercel Remote Cache is free for all plans. Get started today at vercel.com.
Turborepo can use a technique known as Remote Caching to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:
cd my-turborepo
# With [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation) installed (recommended)
turbo login
# Without [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation), use your package manager
npx turbo login
yarn exec turbo login
pnpm exec turbo loginThis will authenticate the Turborepo CLI with your Vercel account.
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:
# With [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation) installed (recommended)
turbo link
# Without [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation), use your package manager
npx turbo link
yarn exec turbo link
pnpm exec turbo linkUseful Links
Learn more about the power of Turborepo:
