This is the official Knock JavaScript SDK monorepo. Knock provides flexible, reliable notifications infrastructure.
-
packages/- Published npm packages under@knocklabs/scopeclient- Core JavaScript client for Knock APIreact- React SDK with hooks and components for web notification UIsreact-native- React Native SDK for mobile appsreact-core- Shared internal utilities for React SDKsexpo- Expo integrationtypes- Shared TypeScript typeseslint-config,prettier-config,typescript-config- Shared configs
-
examples/- Example applications demonstrating SDK usage -
integration/- Integration tests
# Install dependencies (always from repo root)
yarn
# Build all packages
yarn build
# Run packages in development mode
yarn dev
# Run tests
yarn test
# Type checking
yarn type:check
# Linting
yarn lint
# Format code
yarn format- Monorepo: Uses Yarn workspaces + Turborepo
- Node version: 22.17.0 (see
enginesin package.json) - Package manager: Yarn 4.1.0
- Testing: Vitest
- Releases: Changesets for versioning
# Add to a specific workspace
yarn workspace <workspace-name> add <package>- Unit tests are colocated in
test/directories within each package - Integration tests for React are in
integration/tests/ - Run
yarn testfrom the repo root