/persona-pack:persona-sdk-patternsfrom persona-pack
Provides a production-ready Persona API client wrapper with retry logic, pagination, typed responses, and error classification for identity verification workflows.
Ships in persona-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Singleton API client, typed verification results, pagination through inquiries, error classification.
persona-install-auth setupimport axios, { AxiosInstance, AxiosError } from 'axios';
interface PersonaConfig {
apiKey: string;
version?: string;
baseURL?: string;
}
class PersonaClient {
private http: AxiosInstance;
constructor(config: PersonaConfig) {
this.http = axios.create({
baseURL: config.baseURL || 'https://withpersona.com/api/v1',
headers: {
'Authorization': `Bearer ${config.apiKey}`,
'Persona-Version': config.version || '2023-01-05',
'Content-Type': 'application/json',
},
});
}
async createInquiry(templateId: string, referenceId: string, fields?: Record<string, any>) {
const { data } = await this.http.post('/inquiries', {
data: { attributes: { 'inquiry-template-id': templateId, 'reference-id': referenceId, fields } },
});
return data.data;
}
async getInquiry(inquiryId: string) {
const { data } = await this.http.get(`/inquiries/${inquiryId}`);
return data.data;
}
async listInquiries(params: { referenceId?: string; status?: string; pageSize?: number } = {}) {
const { data } = await this.http.get('/inquiries', {
params: {
'filter[reference-id]': params.referenceId,
'filter[status]': params.status,
'page[size]': params.pageSize || 25,
},
});
return data.data;
}
async getVerification(verificationId: string) {
const { data } = await this.http.get(`/verifications/${verificationId}`);
return data.data;
}
}
// Singleton
let _client: PersonaClient | null = null;
export function getPersonaClient(): PersonaClient {
if (!_client) {
_client = new PersonaClient({ apiKey: process.env.PERSONA_API_KEY! });
}
return _client;
}
function classifyPersonaError(error: AxiosError): { retryable: boolean; message: string } {
const status = error.response?.status;
if (status === 429) return { retryable: true, message: 'Rate limited' };
if (status && status >= 500) return { retryable: true, message: 'Server error' };
if (status === 401) return { retryable: false, message: 'Invalid API key' };
if (status === 422) return { retryable: false, message: 'Invalid request' };
return { retryable: false, message: error.message };
}
| Pattern | Use Case | Benefit |
|---|---|---|
| Singleton | All API calls | One client, consistent headers |
| Error classifier | Retry decisions | Only retry 429/5xx |
| Typed responses | Data access | Autocomplete, type safety |
Apply in persona-core-workflow-a for real KYC flows.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
persona-api, identity-verification, api-client, kyc, typescript
18 skills in this plugin
/persona-ci-integrationCI/CD pipeline for Persona integrations with sandbox API testing.
Use when working with Persona identity verification.
Trigger with phrases like "persona ci-integration", "persona ci-integration".
/persona-common-errorsFix top Persona API errors: 401, 422, webhook signature failures, inquiry state issues.
Use when working with Persona identity verification.
Trigger with phrases like "persona common-errors", "persona common-errors".
/persona-core-workflow-aBuild a complete KYC verification flow with Persona inquiries and embedded UI.
Use when implementing identity verification, building KYC onboarding,
or integrating Persona's hosted flow into your application.
Trigger with phrases like "persona KYC flow", "identity verification",
"persona inquiry workflow", "onboarding verification".
/persona-core-workflow-bWork with Persona verification types: government ID, selfie, database checks.
Use when implementing specific verification checks, reviewing verification results,
or building custom verification workflows.
Trigger with phrases like "persona verification", "government ID check",
"selfie verification", "persona database check", "verification results".
/persona-cost-tuningOptimize Persona verification costs with template selection and caching.
Use when working with Persona identity verification.
Trigger with phrases like "persona cost-tuning", "persona cost-tuning".
/persona-debug-bundleCollect Persona diagnostic info: inquiry IDs, API responses, webhook logs.
Use when working with Persona identity verification.
Trigger with phrases like "persona debug-bundle", "persona debug-bundle".
npx claudepluginhub flight505/skill-forge --plugin persona-packOther plugins' skills for the same job