import { ArrowLeft, Check, Code2, Copy, KeyRound } from 'lucide-react' import { useEffect, useState } from 'react' import { useNavigate, useParams } from 'react-router-dom' import { urmiOtpApi, type UrmiOtpDocumentation } from '../../lib/api' export function UrmiOtpDocsPage() { const { projectId = '' } = useParams() const navigate = useNavigate() const [docs, setDocs] = useState(null) const [loading, setLoading] = useState(true) const [error, setError] = useState('') const [copied, setCopied] = useState(false) useEffect(() => { urmiOtpApi.documentation(projectId) .then(setDocs) .catch((reason) => setError(reason instanceof Error ? reason.message : 'Unable to load documentation')) .finally(() => setLoading(false)) }, [projectId]) if (loading) return
Loading API documentation…
if (!docs) return

{error}

const requestExample = JSON.stringify(docs.api.example, null, 2) async function copyExample() { await navigator.clipboard.writeText(requestExample) setCopied(true) window.setTimeout(() => setCopied(false), 2000) } return (
UrmiOTP · {docs.project.project_name}

API documentation

Message label: {docs.project.message_label} — your product identification in each message. URMI branding remains unchanged.

Unified verification templates for login, recovery, account changes, transactions, and devices.

Generate verification OTP

{docs.api.summary}

{docs.api.method}
Endpoint{docs.api.path}
SMS delivery uses the DLT-approved URMI OTP template. template_type is for categorization; the sent text matches message_preview in the API response.
{Object.entries(docs.api.parameters).map(([name, description]) => (
{name}{description}
))}
Request body
{requestExample}
{docs.templates.map((template, index) => (
{String(index + 1).padStart(2, '0')}

{template.name}

{template.type}

Approved content

{template.content}

Sample

{template.sample}

Use for
    {template.uses.map((use) =>
  • {use}
  • )}
Variables
    {template.variables.map((variable) =>
  1. {variable}
  2. )}
))}
) }