API Docs Security Widget Guide Admin Guide otp.royaltycoding.com
Admin Guide ยท v1.5

Admin Portal User Guide

Everything you need to register, log in, and use the dashboard โ€” managing origins, issuing API tokens, and tuning rate limits for your sites.

Register & Login Origins API Tokens DDoS Config
๐Ÿ“ Create Account โ†— ๐Ÿ”“ Sign In โ†— ๐Ÿ“Š Dashboard โ†—
๐Ÿ‘‹

What is the Admin Portal?

The admin portal is a web dashboard built into the OTP API, available at /dashboard. It gives you a point-and-click interface to manage every aspect of your 2FA integration โ€” no database access or server commands required.

๐ŸŒ
Origin Management

Register the domains your app runs on. Each origin you add is immediately allowed to make API calls. Enable, disable, or remove origins at any time.

๐Ÿ”‘
API Tokens

Create the Bearer tokens that your app uses to authenticate API calls. Name them, revoke them when needed, and create replacements โ€” all from one screen.

๐Ÿ›ก๏ธ
Rate Limit Config

Tune how aggressively the API rate-limits requests from each of your origins. Set tighter limits for sensitive endpoints or loosen them for high-traffic apps.

๐Ÿ“Š
Stats Overview

See at a glance how many origins you have, how many users are enrolled in 2FA, and how many active tokens are in use โ€” all scoped to your account.

Your account is isolated. Each admin account manages only its own origins and tokens. If multiple admins share the same server, they cannot see or modify each other's data.
๐Ÿ“

Creating an Account

Click the button below or open /dashboard/register in your browser. Fill in three fields and click Create Account โ€” you'll be logged in and taken to the dashboard automatically.

๐Ÿ“ Open Registration Page โ†—
your-domain.com/dashboard/register
Full Name
Jane Smith
Password
โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข
Create Account
FieldRules
Full NameYour display name. Shown in the dashboard sidebar.
EmailMust be a valid email address. Used to log in. Must be unique on this server.
PasswordMinimum 8 characters, maximum 128. Choose something strong โ€” this protects all your origins and tokens.
Registration may be closed. If you see a message that registration is disabled, ask your server administrator to enable it temporarily. Once your account is created they will close it again.
๐Ÿ”“

Logging In

Click the button below or open /dashboard/login in your browser. Enter your email and password โ€” after signing in you are redirected to the dashboard. Your session lasts 8 hours.

๐Ÿ”“ Open Login Page โ†— ๐Ÿ“Š Go to Dashboard โ†—
your-domain.com/dashboard/login
Password
โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข
Sign In
After logging in
  • You land on the Overview page
  • Your name and email appear in the sidebar footer
  • Your origins are listed in the sidebar under My Origins
  • Click Sign out in the sidebar to end your session
If you're redirected to login
  • Your session expired โ€” sign in again
  • You tried to access a page that requires a session
  • If the problem persists, clear your cookies and try again
๐Ÿ“Š

Overview Page

The Overview is the first page you see after logging in. It shows a summary of your account and a list of all your origins at a glance.

3
Origins
247
Total Users
189
2FA Enabled
5
Active Tokens
CounterWhat it means
OriginsHow many origins you currently own.
Total UsersThe total number of user accounts across all your origins who have started or completed 2FA setup.
2FA EnabledUsers who have fully completed setup and have 2FA active on their account.
Active TokensAPI tokens that are currently active and can authenticate API calls.

Below the stats is a table of all your origins. Click Manage โ†’ on any row to open that origin's detail page, or use the sidebar links under My Origins.

๐ŸŒ

Managing Origins

An origin is the full address of a website โ€” including its protocol โ€” that you want to allow to use the OTP API. For example: https://myapp.com or http://localhost:3000.

When you add an origin it is immediately added to the allowed list. API calls from that domain will be accepted. When you disable an origin, calls from it are blocked instantly โ€” no data is deleted.

โž• Adding an origin

1
Go to Origins
Click ๐ŸŒ Origins in the sidebar, then click the โž• Add Origin button in the top-right of the card.
2
Enter the origin URL
Type the full origin including protocol. No trailing slash.
Valid examples https://myapp.com  ยท  https://staging.myapp.com  ยท  http://localhost:3000
3
Add a label (optional)
A short note to help you remember what this origin is for โ€” for example Production or Staging server. This is just for your own reference.
4
Click Add Origin
The origin appears immediately in the sidebar with a ๐ŸŸข green dot. Your app can now make API calls from that domain.
One origin per subdomain. https://app.mysite.com and https://mysite.com are two separate origins and need to be registered separately. Ports also matter โ€” https://myapp.com and https://myapp.com:8443 are different origins.

Origin actions

Click an origin in the sidebar to open its detail page. The header bar shows the current status and three action buttons.

ActionWhat it doesReversible?
โธ Disable Immediately blocks all API requests from this origin. Returns 403 Forbidden to callers. All user data and tokens are kept intact. Yes โ€” click Enable
โ–ถ Enable Re-activates a disabled origin. API calls are accepted again immediately. Yes
๐Ÿ—‘ Remove Disables the origin and removes it from your account. Users and tokens are not deleted from the database โ€” only your ownership is released. Partially โ€” another admin can reclaim it
๐Ÿ”‘

API Tokens

API tokens are what your application uses to authenticate every call to the OTP API. Each token belongs to one origin and is only valid when requests come from that origin. They are managed from the API Tokens tab inside each origin's detail page.

โž• Creating a token

1
Open an origin
Click an origin name in the sidebar. Make sure the ๐Ÿ”‘ API Tokens tab is selected.
2
Click โž• Create Token
A dialog opens. Enter a name that describes where this token will be used, for example production-web or staging-app. Then click Create Token.
!
Copy your token immediately
The raw token is shown once only. Once you close the dialog it cannot be retrieved. Copy it now and store it somewhere safe โ€” your app's environment variables or a secrets manager.
Where to put it in your app Store as an environment variable, e.g. OTP_API_TOKEN=abc123...
Pass it server-side to the widget's api-token attribute. Never hard-code it in public HTML or client JavaScript.
Lost your token? Delete it and create a new one. There is no "reveal" option โ€” tokens are stored as hashes and the plaintext is gone after creation. Your users are not affected; just update the token value in your app's environment.

Token actions

ActionWhat it doesReversible?
Revoke Soft-disables the token. It stops accepting API calls within about 15 seconds. The token row stays in the dashboard so you can re-activate it later. Yes โ€” click Activate
Activate Re-enables a previously revoked token. Yes
Delete Permanently removes the token from the database. Cannot be undone. Create a new token if you need to replace it. No
The token list also shows a Last used timestamp. This is useful for spotting stale tokens that are no longer being called โ€” you can safely delete them to keep your token list tidy.
๐Ÿ›ก๏ธ

DDoS Config

The DDoS Config tab inside each origin's detail page lets you override the server's global rate-limit settings for that origin specifically. This is useful when one of your apps has higher legitimate traffic than the defaults allow, or when you want tighter limits on a sensitive endpoint.

Each origin has four independent layers you can configure. Layers marked default are using the server's global settings. Layers you've changed show a override badge.

The four layers

global
Global

Covers all routes. The broadest limit โ€” a per-IP ceiling on the total number of requests in a time window.

auth
Auth

Covers all /auth/* routes. A stricter limit specific to authentication endpoints.

verify
Verify

Covers the code-verify and disable endpoints only. The tightest limit โ€” designed to stop brute-force attacks on 6-digit codes.

slowdown
Slowdown

Instead of blocking, adds a growing delay to each request after a threshold. Degrades bot performance without hard-blocking real users.

What you can change

SettingWhat it controls
EnabledToggle to turn a layer completely on or off for this origin.
Window (min)The rolling time window in minutes. Requests older than this are not counted towards the limit.
Max requestsHow many requests are allowed per IP within the window before a 429 Too Many Requests is returned.
Delay after (slowdown only)How many free requests are allowed before delays start being added.
Delay (ms) (slowdown only)Milliseconds added to each request beyond the free threshold.
Max delay (ms) (slowdown only)The maximum total delay that can be added โ€” the ceiling.
Saving changes: Click the ๐Ÿ’พ Save button on the layer card you changed. Changes take effect within about 30 seconds โ€” no restart needed. To undo your changes and go back to the server defaults, click โ†ฉ Reset to default (only visible when an override is active).
โ“

FAQ

Can I have more than one origin on a single account?

Yes. Add as many origins as you need โ€” production, staging, local development โ€” they all appear in your sidebar. Each has its own tokens and rate-limit config.

Can two admin accounts share the same origin?

No, one origin can only be owned by one admin at a time. To transfer ownership, the current owner removes it from their account and the new owner adds it to theirs.

I lost my API token. What should I do?

Delete the lost token and create a new one. Tokens are shown once at creation and cannot be recovered. Update the token value in your app โ€” your users' 2FA setup is not affected.

How quickly does revoking a token take effect?

Within about 15 seconds. There is a short in-memory cache to reduce database load. After the cache expires, any request using the revoked token is rejected.

If I disable an origin, do my users lose their 2FA setup?

No. Disabling an origin blocks new API calls from that domain, but all user accounts, secrets, and tokens remain in the database. Re-enabling the origin restores full access immediately.

Can the same email be used across two different origins?

Yes. Each origin is a completely separate namespace. [email protected] on https://app1.com and