Choose an environment

The (environment) property configures which Swing API environment is used.

Testnet

The testnet environment integrates with contracts deployed to testnets. Using this environment is great for local development and testing. You can use all of the features of the widget, without needing to use real funds. Check available routes

Production

The production environment integrates with contracts deployed on mainnet. This is the default environment.

Setup

Add the environment property to the widget component with the value of either testnet or production. If the environment property is omitted, the production environment will be used.

import { SwingSDK } from '@swing.xyz/sdk';
 
const swingSDK = new SwingSDK({
  // Your Swing Platform project identifier
  projectId: 'swing-project-id',
 
  environment: 'production', // (or "testnet")
});