Skip to content

isPublishableKey()

Function@tryyoursize/sdk

A publishable key is the only key allowed in a browser.

function isPublishableKey(key: string): boolean
keystringRequired

Any string.

boolean: True for pk_test_… and pk_live_… keys.

import { isPublishableKey } from "@tryyoursize/sdk";
if (!isPublishableKey(settings.tysKey)) throw new Error("Use the publishable key");

Was this page helpful?