API Key Management

{#if newKey}

{mode === 'emergency' ? 'Emergency Rotation Complete' : 'New API Key Generated'}

This key will not be shown again. Copy it now.

{newKey}
{#if mode === 'normal' && expiryDate}

The previous key will remain valid until {new Date(expiryDate).toLocaleString()} to give in-field devices time to update.

{/if}
{/if} {#if toastMessage}
{toastMessage}
{/if}

Current Key Status

{#if data.activeKey}
Prefix: {data.activeKey.prefix}
Created: {new Date(data.activeKey.createdAt).toLocaleString()}
{#if data.activeKey.expiresAt}
Expires: {new Date(data.activeKey.expiresAt).toLocaleString()}
{/if}
{:else}

No active API key. Generate one below.

{/if} {#if data.totalRotated > 0}

{data.totalRotated} previous key(s) have been rotated.

{/if}