Using login in dummy mode

UserKit lets you use a core set of features with a dummy app-id and key:

  • Dummy app-id: "dummy"
  • Dummy secret-key: "dummy.dummy"

This can be useful for running integration or unit tests, or running a shared project in a development environment where sharing a secret key isn't an option.

Use the dummy app-id and secret-key anywhere in your code that you would normally use a UserKit app id or secret key.

Logging in a dummy user

Logging in will result in a dummy user with a username matching whatever username you enter at login.

📘

Note: User sign-up doesn't work in dummy-mode. Instead, use the login widget form or endpoint with any valid username, and "password" as the password. This will result in a dummy user matching the username you entered.

To login a dummy user

Only username/password login is supported in dummy mode.

  • Enter any valid username in the username field.
  • Enter "password" in the password field. Any other password will result in login failure.

This will result in a dummy user with the following properties:

usernameWhatever username you entered during login
email<username>@example.com
nameUsername with upper-cased first letter. For example: "user1" would result in a name of "User1".
id"dummy_usr__<username>"

Fetching a dummy user via UserKit's server API

From your server, you can use the UserKit server API to fetch a dummy user by using a valid dummy user-id that looks like this: dummy_usr__<username>.

This will return a user object with matching username, just like when logging in a dummy-user.