
# Test users and messages in non-production environments

The `development` and `staging` environments are made for tests. They differ from `production` in two ways: you can sign in with test users and a fixed code, and every message the environment sends is marked and limited so that it cannot be mistaken for a real one. Two parts of this page are not available yet and are marked `planned`: the log tail entries and SMS.

## Test users and the fixed code

A test user is a normal user whose identifier is reserved for tests:

- **Test email address:** the local part carries a `+test` tag, for example `ada+test@example.com` or `ada+test_1@example.com`.
- **Test phone number:** a number from `+1 555 555 0100` to `+1 555 555 0199`, a range reserved for fictional use.

In `development` and `staging`, nothing is sent to these identifiers. In `development`, the one-time code and the magic link code are always accepted as `424242`. (`planned`: the real code is generated as well and appears in the log tail, so you can also test with it.)

The fixed code works only for test identifiers in `development`. For any other address, and in `staging`, it is not valid. In `production`, a `+test` address behaves like any other address and the fixed code does not exist. Test users count towards your normal user count.

Create test users with the [create user](/docs/api/management/users/create) call, the same as any other user.

To get tokens for a test user without the login page, run `keenauth test login --user ada+test@example.com --client-id <application ID>` (see [Signing in test users with keenauth test login](/docs/cli/test-login)).

## Message prefix and suppression

In `development` and `staging`, every outgoing email is marked: its subject starts with `[DEV]` or `[STAGING]`. You cannot remove the prefix, neither in a custom template nor in the call that sends the message. It makes it harder to abuse the environment for phishing.

The environments also limit how many emails leave the platform each day. The limit depends on how the environment sends email:

| | `development` | `staging` |
|---|---|---|
| Platform sender (default) | Up to 100 per day | Up to 100 per day |
| Your own SMTP server or email provider | Up to 500 per day | Up to 2,000 per day |
| SMS (`planned`) | Sent only to the verified numbers of environment members. Messages to test numbers are suppressed without sending. | Up to 100 per day |

A message over the limit is suppressed and not sent. (`planned`: the log tail shows a `message_suppressed` entry.) The body of an SMS will carry the same `[DEV]` or `[STAGING]` prefix.

The sender address in these environments is the platform's shared domain. A custom sender domain that the platform manages works only in `production`. Your own SMTP server or email provider works in every environment type, with the prefix and the limits above.
