Docs

Environments and Keys

Every project has a test and a live environment, and two kinds of API keys. Here is what each one sees and where it belongs.

Every Lander project has two environments, test and live, like test mode in a payments dashboard. Build and try things in test, then switch your app to a live key when you ship. Test links, keys and events never mix with your live numbers.

What is separate, and what is shared

Separate per environmentShared by test and live
LinksYour iOS and Android app settings (Platforms)
API keysLink domains, hosted and custom
Installs, opens, clicks and eventsDeferred deep linking settings
AnalyticsTeam members and billing

Because domains are shared, a slug is unique per domain across both environments: a test link and a live link cannot both be acme.golander.link/summer-sale.

The edge redirects test and live links in exactly the same way. The difference shows up in the app: a pk_test_ key only resolves test links, and a pk_live_ key only resolves live links. Open a live link in a build that uses a test key and the app receives it unresolved (isResolved == false).

Switching in the dashboard

The Test / Live switch at the top of the dashboard decides which environment every page shows. It starts in test, and while it is on test a banner reads "Test mode: links, keys and events here are separate from live data". Links you create are created in the environment you are looking at. See Environments in the dashboard.

Keys

Keys belong to one project and one environment. The key alone tells Lander which project and environment a request is for, so clients never send a project ID.

KeyPrefixWhere it goesWhat it can do
Publishablepk_test_, pk_live_Your Flutter appResolve links, report launches and events, create links from the app, claim handoffs
Secretsk_test_, sk_live_Your server onlyEverything a publishable key can do, plus manage links (/v1/links), create handoffs and change deferred deep linking settings

A key looks like pk_live_ followed by at least 24 letters and digits.

  • Publishable keys are safe to ship. Anything inside an app is public, so they can only do what the app itself needs. Lander.initialize rejects secret keys outright.
  • Secret keys never ship. They can create, change and delete links. Keep them on your server.
  • You see a key once. Lander stores only a hash, so copy the key when you create it. If you lose it, create a new one.
  • Revoke instead of rotate in place. Create the replacement, deploy it, then revoke the old key under Settings > API keys.

Create keys under Settings > API keys, in the environment you need. See API keys.

Going live

  1. Switch the dashboard to Live and create a publishable key. It starts with pk_live_.
  2. Create your live links. Test links stay in test.
  3. Put the live key in your release build. One way is to pass the key at build time:
lib/main.dart
// flutter run --dart-define=LANDER_KEY=pk_test_...
// flutter build ipa --dart-define=LANDER_KEY=pk_live_...
await Lander.initialize(apiKey: const String.fromEnvironment('LANDER_KEY'));

An install belongs to one project and environment. When an app that ran with a test key starts with a live key, the SDK notices, creates a new install ID and reports a first launch for the live environment. Nothing for you to do.

Usage counts both

Plan usage counts link clicks (not bots) and SDK events from both environments. See Billing.

On this page