Skill — Copyable reference implementation. Use as-is or customize. See Skills Philosophy.
Planned Implementation
Identity (ID Registry)
Keys
Frames
Resources
Related
- siwe-authentication — Sign-in patterns
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Social protocol integration with Farcaster
import { Farcaster } from './Farcaster.js';
const fc = Farcaster({
provider,
idRegistry: ID_REGISTRY,
keyRegistry: KEY_REGISTRY,
});
// Get FID for address
const fid = await fc.getFid(address);
// Get custody address for FID
const custody = await fc.getCustodyAddress(fid);
// Register new FID
await fc.register({
recovery: recoveryAddress,
signer,
});
// Add signer key
await fc.addKey({
fid,
key: signerPublicKey,
keyType: 1, // Ed25519
signer,
});
// Remove key
await fc.removeKey({
fid,
key: signerPublicKey,
signer,
});
// Validate frame action message
const { isValid, message } = await fc.validateFrameAction(
trustedData.messageBytes
);
if (isValid) {
console.log('FID:', message.fid);
console.log('Button:', message.buttonIndex);
console.log('Input:', message.inputText);
}
Was this page helpful?
