Ir al contenido

<TryYourSizeProvider>

Esta página aún no está disponible en tu idioma.

Component@tryyoursize/react

Creates (or adopts) the TryYourSize client and its elements group for the components inside it. Pass either publishableKey or client; it cannot change once set.

function TryYourSizeProvider(props: TryYourSizeProviderProps): ReactNode
childrenReactNodeOpcional
optionsTryYourSizeProviderOptionsOpcional
Propiedades
embedOriginstringOpcional

Development override of our windows' origin (e.g. http://localhost:5173). Used with publishableKey.

apiOriginstringOpcional

Development override of the API origin (e.g. http://localhost:8000): the A/B holdout config.

localeLocaleOpcional

Language of our windows; "auto" follows the browser.

appearanceAppearanceOpcional

Look and feel. Changes are applied live with elements.update().

publishableKeystringOpcional

Either this or client. Your publishable key (pk_test_… / pk_live_…). The provider calls TryYourSize().

clientTryYourSizeClient | Promise<TryYourSizeClient | null> | nullOpcional

Either this or publishableKey. A client, a promise of one (for example loadTryYourSize(pk)), or null while you don't have one yet.

// With a key
<TryYourSizeProvider publishableKey="pk_test_…" options={{ locale: "es" }}>
<App />
</TryYourSizeProvider>
// With the CDN loader (SSR-safe)
const tysPromise = loadTryYourSize("pk_test_…");
<TryYourSizeProvider client={tysPromise}>
<App />
</TryYourSizeProvider>

¿Te ha resultado útil esta página?