(credentialId: string)
| 107 | * Looks for a design with "badge" in its name, falls back to the first design. |
| 108 | */ |
| 109 | export async function getCredentialBadgeUrl(credentialId: string): Promise<string | null> { |
| 110 | const designs = await getCredentialDesigns(credentialId); |
| 111 | if (!designs.length) return null; |
| 112 | |
| 113 | const badge = designs.find(d => d.name.toLowerCase().includes('badge')) || designs[0]; |
| 114 | const png = badge.previews.find(p => p.format === 'png'); |
| 115 | return png?.url || null; |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * Check whether Certifier integration is configured. |
no test coverage detected