DocsTesting and going live

Testing and going live

Planned

Build and test against test keys first. When your domain is verified and your server checks tokens, switch the site to live.

Test and live keys

Each site has a pair of keys per mode. Test and live keys never mix: a token made with a test key is not accepted by a live site, and the other way round.

Key types
KeyLooks likeWhere it goes
Publishablepk_test_9fK2 or pk_live_...In your page, passed to Ageseal.check. Public by design.
Secretsk_test_Hn4x or sk_live_...On your server only, for redeeming tokens. Shown once when you create it. Ageseal keeps only a hash, so a lost key must be rolled.

You can roll a secret key without downtime: the old key keeps working for a grace period after you create the new one.

Test mode

  • Test mode is free and not limited in volume. Test checks are not counted at all: they are not in your usage figures and are never billed.
  • Test keys accept credentials from test issuers only, and live keys accept production issuers only. The two are never mixed. Which production issuers are trusted is not final yet.
  • Allowed origins must be https without a port, so a test key cannot be used from http://localhost. Use a tunnel or a staging host on a domain you have verified.
  • Tokens from test mode have their own issuer and audience: iss is https://api.ageseal.eu/test, aud is test: followed by your site id, and mode is test. A server that checks iss and aud for live refuses them. See Test tokens.
  • Anyone can make a test token that says pass, because the test issuer is public. Never accept a test token in production.
  • The Developer plan includes 100 live checks in total for one site, and test mode after that.

Verify your domain

Before a site can go live, prove you control its domain. A site is a registrable domain such as example.com. Staging hosts and subdomains are covered by the same site and are added as allowed origins.

The dashboard gives you a token for the site. Use either method, then choose Check now.

DNS TXT record

DNS record
Name:   _ageseal.example.com
Type:   TXT
Value:  ageseal-verify=<your token>

Some DNS providers want the name without the domain, just _ageseal. Records can take a few minutes to appear.

Meta tag

index.html
<head>
  <meta name="ageseal-verify" content="<your token>">
</head>

Ageseal fetches https://<your domain>/ and looks for the tag in the first 256 KB of the page. It only uses https, gives up after 5 seconds and follows up to 3 redirects, and only while they stay on the same host. A redirect to another host, scheme or port is not followed, so serve the home page, with the tag, on the domain itself.

Going live checklist

  1. Your domain is verified, and every origin that shows the gate is listed as an allowed origin (staging and subdomains included).
  2. Your server verifies tokens with the live values: signature, iss, aud (your site id, without test:), exp, over, result and mode (it must be live). See Verify tokens.
  3. You never trust the browser result on its own. Access is granted only after the server check.
  4. Your fallback works and has been tried on a browser without wallet support. See Fallback.
  5. You swapped the test keys for live keys in the page and on the server, and the secret key is stored as a secret, not in the page or the repository.
  6. Your CSP allows the SDK host. See Browser SDK.
  7. You added a card in Billing, set a spend cap if you want one, and checked that email alerts reach the right inbox.
  8. You tried the full flow in Chrome and Safari with a real wallet, from a phone and from a desktop.

Then switch the site from Test to Live in its settings. You can switch back at any time.