Skip to main content

Create a key

  1. Register in the Partner Dashboard.
  2. Create an organization, then create an app inside it.
  3. Open the app and copy its mainnet or testnet API key.

Select an environment

Layerswap uses the same API base URL for both environments:
The API key selects the environment. A testnet key returns testnet networks and routes; a mainnet key returns mainnet data. In the Widget, the config.version value must match the key’s environment.

Authenticate an API request

Send the key in the X-LS-APIKEY header:

Use a key with the Widget

Pass the object to LayerswapWidget or LayerswapDepositWidget. See the Swap Widget quickstart for a complete example.