Use Paddle.Environment.set() to set the environment for your checkout.
Only used to set the sandbox environment. If not present, Paddle uses the production environment.
You should call this method before calling any other Paddle.js methods, ideally just before your Paddle.Initialize() call.
Parameters
environmentstring
Default:
productionPaddle environment that you're working with.
Values
sandboxSandbox environment. Used for testing.productionLive environment. Used in production.
Examples
This example sets the environment to sandbox.
Paddle.Environment.set("sandbox");Paddle.Initialize({ token: "live_7d279f61a3499fed520f7cd8c08", pwCustomer: {},});import { initializePaddle } from "@paddle/paddle-js";
const paddle = await initializePaddle({ environment: "sandbox", token: "live_7d279f61a3499fed520f7cd8c08", pwCustomer: {},});We recommend removing Paddle.Environment.set() before going live.
This example doesn't set the checkout environment. Paddle defaults to production.
Paddle.Initialize({ token: "live_7d279f61a3499fed520f7cd8c08", pwCustomer: {},});import { initializePaddle } from "@paddle/paddle-js";
const paddle = await initializePaddle({ token: "live_7d279f61a3499fed520f7cd8c08", pwCustomer: {},});