Skip to content

Web and desktop setup

Client Public package Use
Headless TypeScript @rambax/one-core Browser, desktop, or a custom UI
React @rambax/one-react React components over the core client
Svelte @rambax/one-svelte Svelte components and adapters over the core client

Public package artifacts are prepared and tested outside the repository. Registry publication is still pending; do not assume npm install @rambax/one-core is available yet. Until publication, install the versioned tarballs supplied by One. Install the core tarball alongside the React or Svelte adapter in the same command so the adapter resolves the matching version:

Terminal window
npm install ./rambax-one-core-VERSION.tgz
# React: install both tarballs and your application's React dependencies
npm install ./rambax-one-core-VERSION.tgz ./rambax-one-react-VERSION.tgz
# Svelte: install both tarballs in your Svelte 5 application
npm install ./rambax-one-core-VERSION.tgz ./rambax-one-svelte-VERSION.tgz

Replace VERSION with the supplied release version. Artifacts include JavaScript, declarations and their dependencies; consumers do not need the private @repo/* workspace packages. Keep the core and adapter versions matched. React components also export @rambax/one-react/styles.css.

After installing the core package:

import { createOneClient } from '@rambax/one-core';
export const one = createOneClient({
publicKey: 'YOUR_TEST_PUBLIC_KEY',
});

Share this client. Do not construct it on every render. The SDK’s API origin is fixed; there is no app-level apiUrl setting.

For a desktop companion, declare the actual platform:

export const desktop = createOneClient({
publicKey: 'YOUR_DESKTOP_TEST_PUBLIC_KEY',
platform: 'macos', // use 'windows' for Windows
});

Configure the app’s allowed browser origins and authentication redirect URLs before testing browser sign-in. Keep secret keys and provider credentials on trusted servers.

Use the SDK’s verified link flow when customers need to connect apps:

const link = await one.createCustomerLinkToken();
await desktop.redeemCustomerLinkToken(link.token);

Treat the token as a temporary credential. Do not log or publish it. Do not replace this flow with an email lookup or copied customer identifier.

Import OneProvider and React components from @rambax/one-react; import Svelte components and adapters from @rambax/one-svelte. In a Next.js app, create your shared client and provider in a "use client" component. Do not pass a constructed client with methods from a server component into a client component.

Verify page reload, sign-in/out, session recovery, checkout return, and access after payment. Check the target renderer’s supported paywall contract before publishing a creative. A successful native iOS preview does not establish web renderer compatibility.