Splitworthy documentation

npm packages & local installation

Build and install typed browser and React packages before the first public npm release.

Prepared for npm — not published yet

The legacy names are @testwell/browser-sdk (0.5.0) and @testwell/react (0.4.0). Both have compiled ESM exports, TypeScript declarations and public publish settings. Existing package names stay unchanged for compatibility. Neither is currently advertised as available from the npm registry.

An npm account with permission to publish under the @testwell scope and release approval is required. Do not run npm install @testwell/react against the registry until the release has actually been published and checked. React remains an early adapter with the limitations in its dedicated guide.

Build archives from authorised source access

From this repository root, use Bun and the installed project dependencies to build both packages. npm pack includes only dist and README files. Pack the browser SDK first; the adapter declares it as a peer dependency, not a relative source file.

The browser script and WordPress distribution are separate from npm package builds. npm archives do not require the hosted browser script, but configuration and events still use the real platform API and verified customer origin.

bash
bun install
bun run packages/build-npm.ts sdk
bun run packages/build-npm.ts react
mkdir -p /tmp/splitworthy-packages
(cd packages/sdk && npm pack --ignore-scripts --pack-destination /tmp/splitworthy-packages)
(cd packages/react && npm pack --ignore-scripts --pack-destination /tmp/splitworthy-packages)

Install into your application

Copy the generated archives to your application and replace the paths below with their actual location. Install both together for React; React 18 or 19 must already be installed in your application. The browser package has no React dependency.

Use the React guide for the provider, consent, rendering and exposure examples. For the framework-free API use createSdk from the browser package and supply the documented browser environment after hydration. ESM is supported; CommonJS require is not provided.

text
npm install ./vendor/testwell-browser-sdk-0.5.0.tgz ./vendor/testwell-react-0.4.0.tgz

// React application:
import { TestwellProvider, useTestwellExperiment } from "@testwell/react";
// Plain TypeScript/JavaScript application:
import { createSdk } from "@testwell/browser-sdk";

Maintainer release checklist

Verify npm scope ownership and package-name availability with the release account; never put npm tokens in application code. Review packed contents and clean-consumer imports/types, then publish the browser package before the React adapter using npm publish --access public from each package directory.

Verify npm view for the exact versions and test a fresh registry installation before documenting registry installation as available. Public package publication and platform deployment are separate actions and neither has been performed here.