Search

Are you looking for test card numbers?

Would you like to contact support?

Developer-resource icon

Migrate to client key

Learn about how and why to switch to using the client key.

If your Web integration uses the origin key or your iOS integration uses the client encryption public key, consider switching to the client key. The client key makes it easier for you to manage the origins for your integration.

With the client key, you have:

  • A single key for all your allowed origins in an environment.
  • Flexibility to add and remove origins without having to generate a new client key.
  • A human-readable prefix, test or live, so you can easily tell which environment a client key is linked to.

The client key also enables card type detection through Bank Identification Number (BIN) lookup, which is not available when using the origin key.

Availability and compatibility

The client key is available for the following:

Integration Version
Web Drop-in and Components 3.10.1 and later.
Previous versions require origin keys for client-side authentication.
iOS Drop-in and Components 3.7.0 and later.
Previous versions require client encryption public keys.

The client key is backwards compatible with the origin key and the public key. Generating a client key doesn't invalidate a pre-existing origin key or public key.

Switch to using the client key

  1. Log in to your Customer Area.
  2. Go to Account > API credentials, and select the API credential for your integration, for example ws@Company.[YourCompanyAccount].
  3. Add your domains under Allowed origins. These are the domains from which you will be sending your client-side requests.
  4. Under Authentication, select Generate New Client Key.
  5. Select Save.
  1. Replace the keys used in your Web or iOS integration.

Web

You must be running Web Drop-in or Web Components version 3.10.1 or above.

Replace originKey in your Web Drop-in or Web Components configuration object with:

  const configuration = {
      ...
      clientKey: "YOUR_CLIENT_KEY",
      ...
  }

iOS

You must be running iOS Drop-in or iOS Components version 3.7.0 or above.

Replace publicKey in your iOS Drop-in or iOS Components configuration with clientKey:

iOS Drop-in:

let configuration = DropInComponent.PaymentMethodsConfiguration()
    ...
    configuration.clientKey = "YOUR_CLIENT_KEY"
    ...

iOS Components:

 // Replace CardComponent with the payment method Component that you want to add.
 let cardComponent = CardComponent(paymentMethod: cardPaymentMethod)
    ...
    cardComponent.clientKey = "YOUR_CLIENT_KEY"
    ...

See also