Getting Your Personal Access Token
Log in to Recurse Center
Navigate to recurse.com and log in with your account.
Generate a New Token
Create a new personal access token with a descriptive name (e.g., “VCF Generator”).
The token will only be displayed once. Make sure to copy it immediately and store it securely.
Authentication Methods
The RC API client supports two authentication methods:- Bearer Token (Recommended)
- Basic Authentication
This is the default and recommended method. It uses a personal access token:The Bearer token is sent in the
Authorization header:This method is used by default in the VCF generator (see
main.rs:323-326).Authentication Implementation Details
TheAuthentication enum is defined in rc_api.rs:355-372:
Verifying Your Token
You can verify your token works by fetching your own profile:Troubleshooting
Error: RECURSE_PAT environment variable not set
Error: RECURSE_PAT environment variable not set
This error occurs when the environment variable is not set. Make sure you’ve exported it:Verify it’s set:
Error: Authentication failed (401)
Error: Authentication failed (401)
This means your token is invalid or has expired. Generate a new token from your Recurse Center account settings.
Using .env files
Using .env files
The VCF generator supports The token will be automatically loaded when you run the program (see
.env files via the dotenv crate. Create a .env file in your project root:main.rs:311).Security Best Practices
- Never hardcode tokens in your source code
- Don’t commit tokens to version control
- Rotate tokens regularly to minimize security risks
- Use environment variables or secure secret management systems
- Grant minimal permissions when creating tokens
- Revoke unused tokens from your account settings
API Rate Limits
The Recurse Center API has rate limits to ensure fair usage. The VCF generator handles this by:
- Fetching profiles in batches of 50 (see
main.rs:336) - Including retry logic with 5-second delays on failures (see
main.rs:390-395) - Using efficient pagination with offset/limit parameters