Skip to main content
The Cesto Web SDK puts the whole invest flow on your own page. Your button opens a themed Cesto dialog, the visitor signs in, funds, and invests inside it, and your page gets the outcome as a callback. Nothing navigates away. The loader itself is deliberately thin: it holds no tokens, makes no requests, and stores no state. Everything sensitive happens on the Cesto origin inside the dialog.

Drop-in

A script tag and a data-cesto-invest attribute is a complete integration. No build step required.

Themed to your site

Eight color and shape tokens, applied to the dialog and to the bundled button, so the two never disagree.

Events you can act on

onSuccess, onScheduled, onError, onPositionClosed, and more — fired on your page, ready for your analytics.

React-native (the other kind)

<CestoProvider>, a styled <CestoInvestButton>, and useCestoInvest(). Client-only, Next.js App Router friendly.

The packages

Not to be confused with @cesto/sdk, the Server SDK. That one runs on your backend with a secret key and gives you the full API. This one runs in the browser with a publishable key and gives you the invest flow. See Choose your integration.

What it looks like

How the flow runs

1

Your CTA is clicked

The loader opens the invest surface — by default an in-page dialog: a full-viewport transparent iframe onto app.cesto.co/invest/<basket>. A popup window is available as an option and as an automatic fallback.
2

Cesto verifies your key

The backend matches your publishable key against the page’s origin and onVerified fires with { partner }, switching on your branding and attribution.
3

The user signs in, funds, and invests

All inside the dialog, on the Cesto origin. Some sign-in methods cannot be framed and move to a top-level window — the dialog stays on your page and waits. See Modes.
4

You get the outcome

onSuccess with { basket, amountUsd, status }, or onScheduled if the market is closed, or onError. See Events.

Requirements

  • A publishable key (cesto_pk_…) and the origins you will embed from — see API keys.
  • A basket slug (the last path segment of app.cesto.co/product/<slug>) or product UUID.
  • A modern browser. React bindings need React 18 or later.
Call invest() synchronously inside the click handler — no await, no timer before it. Browsers block popups that are not tied to a user gesture, and even in dialog mode the popup fallback can kick in.

Next steps

Quickstart

A working invest button in three flavours.

Script tag

The no-build path: data attributes and bindInvestButtons.

JavaScript API

The Cesto class, invest(), and the session handle.

React

Provider, button, and hook reference.

Modes

Dialog vs popup, the fallback, and the login handoffs.

Theming

Eight tokens, and how they reach the dialog.

Events

Every callback, when it fires, and how often.

Security

Why a public key is safe, and what the loader refuses to do.

Troubleshooting

Popup blockers, COOP, CSP, and local testing.