bootstrap-api-keys

Generate API key schema, context functions, LiveView UI, and Bearer auth in Phoenix 1.8.

1|Updated May 7, 2026
One-click install
npx skills add https://github.com/agoodway/GoodSkills --skill bootstrap-api-keys
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bootstrap-api-keys
Source: https://github.com/agoodway/GoodSkills/tree/main/skills/bootstrap-api-keys
Command: npx skills add https://github.com/agoodway/GoodSkills --skill bootstrap-api-keys

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Creating and maintaining API key authentication in a Phoenix 1.8 app is repetitive and error-prone, especially when you need secure token handling, revocation, and a user-facing management UI.

Core Features & Use Cases

  • Discovers existing components first: Audits migrations, schema, context functions, LiveView, auth plug, and router entries to avoid duplicating or overwriting partial implementations.
  • Generates missing backend + UI: Adds the api_keys migration and ApiKey schema, context functions for create/list/revoke/verify/touch, an ApiKeyLive.Index LiveView with modals for create/token/revoke, and the Bearer token auth plug.
  • Ensures key security patterns: Never stores raw tokens (stores prefix + SHA256 hash), shows the raw token only once after creation, supports optional expiration, and uses soft revocation.

Quick Start

Ask your AI assistant to run bootstrap-api-keys in your Phoenix 1.8 app to add end-to-end API key CRUD with Bearer authentication at /api-keys.

Frequently Asked Questions about bootstrap-api-keys

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add API key authentication to a Phoenix LiveView application?

API key authentication in a Phoenix LiveView app is added by generating an ApiKey schema, context functions for create and revoke, a management LiveView UI, and a Bearer token auth plug. This provides end-to-end CRUD with secure token handling at /api-keys.

What is the best way to store API keys securely in a Phoenix backend?

Secure API key storage in a Phoenix backend uses prefix plus SHA256 hash verification, never storing raw tokens. The raw token is shown only once after creation, and keys support optional expiration and soft revocation for safe access control.

Does the generated API key management UI work with existing Phoenix auth pipelines?

The API key management UI integrates with existing Phoenix auth pipelines by discovering your current auth plug and router entries first, then mounting a scoped LiveView management page within authenticated sessions to avoid overwriting partial implementations.

Can I revoke an API key without deleting it from the database in Phoenix?

Soft revocation lets you revoke an API key in Phoenix without deleting the database record. The generated context functions include a revoke operation that disables the key while retaining it, along with optional expiration support for time-limited access.

How do I verify Bearer tokens for scoped API endpoints in Phoenix?

Bearer token verification for scoped API endpoints in Phoenix uses a generated auth plug that checks the prefix and SHA256 hash of the incoming token. The plug integrates into your router pipeline for authenticated and write-required API endpoints.

What happens to existing migrations and schemas when generating API key management?

Existing migrations, schemas, context functions, and LiveView components are audited first during generation to avoid duplicating or overwriting partial implementations. The tool uses discovery-driven gap filling to only add what is missing for API key management.