CargoLabs Docs

Keys and test mode

Publishable keys identify your platform; test keys let you integrate without real charges.

Publishable keys

Publishable keys start with pk_live_ or pk_test_ and are created in the developer portal under API Keys. They are safe to ship in browser and mobile code because they can only do one thing: start a quote session on your behalf.

The key identifies your platform. Every purchase made through a flow opened with your key is attributed to you, and any platform fee configured on that key is added on top of the CoverPort price at checkout.

PrefixCharges real cardsShows "Test mode" badgeUse for
pk_test_NoYesLocal development, staging, CI
pk_live_YesNoProduction

Key configuration

Each key in the developer portal has two settings that affect embedded sales:

  • Insurance agent. The CoverPort agent whose products are offered in the flow. Pick the agent you have an arrangement with.
  • Platform fee. A percentage and/or fixed amount (in cents) added on top of the CoverPort charge. The buyer sees the combined price at checkout.

Changing either setting takes effect on the next quote session. No code change is needed.

Validation

The SDK checks the key format before it does anything else:

^pk_(live|test)_[A-Za-z0-9]+$

If the format is wrong, mount() and open() throw synchronously with a message that names the problem. If the format is right but the key is unknown to CoverPort, the modal opens and shows an "invalid key" message instead of the quote flow. See Troubleshooting.

Secret keys

Secret keys (sk_…) authenticate server-to-server calls to the REST API. They are never accepted by the SDK and must never appear in client code.

On this page