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 sending instructions…
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 (
Verification codes · {docs.project.project_name}

How to send a code

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.

Send a verification code

{docs.api.summary}

{docs.api.method}
Address{docs.api.path}
Customers receive the approved verification text. The type you choose only groups the request. The message they see matches the preview.
{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. )}
))}
) }