Ir al contenido

TryYourSize()

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

Function@tryyoursize/sdk

Creates a client for your publishable key. Every element and call goes through it.

function TryYourSize(publishableKey: string, options: TryYourSizeOptions = {}): TryYourSizeClient
publishableKeystringObligatorio

Your publishable key (pk_test_… or pk_live_…) from Studio → Developers → API keys. It works only on the origins registered for it. A secret key (sk_…) throws secret_key_in_browser.

optionsTryYourSizeOptionsOpcional= {}
Propiedades
embedOriginstringOpcional

Override for development (e.g. http://localhost:5173).

apiOriginstringOpcional

Override of the API origin for development (e.g. http://localhost:8000): the A/B holdout config.

localeLocaleOpcional

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

TryYourSizeClient: The client: elements(), recommendation(), recommendationHandle(), experiment() and version.

TryYourSizeError with code secret_key_in_browser or invalid_key. See Web SDK errors.

import { TryYourSize } from "@tryyoursize/sdk";
const tys = TryYourSize("pk_test_…", { locale: "es" }); // windows in Spanish

¿Te ha resultado útil esta página?