Skip to main content
The RC VCF Generator uses the Recurse Center API to fetch profile data. You’ll need a personal access token to authenticate your requests.

Getting Your Personal Access Token

1

Log in to Recurse Center

Navigate to recurse.com and log in with your account.
2

Navigate to Settings

Go to your account settings page to manage your personal access tokens.
3

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.
4

Set the Environment Variable

Export the token as the RECURSE_PAT environment variable:
export RECURSE_PAT="your_token_here"
To make this permanent, add it to your shell configuration file (~/.bashrc, ~/.zshrc, etc.):
echo 'export RECURSE_PAT="your_token_here"' >> ~/.bashrc
source ~/.bashrc

Authentication Methods

The RC API client supports two authentication methods:

Authentication Implementation Details

The Authentication enum is defined in rc_api.rs:355-372:
pub enum Authentication {
    Bearer(String),
    Basic { email: String, password: String },
}

impl Authentication {
    fn to_header_value(&self) -> String {
        match self {
            Authentication::Bearer(token) => format!("Bearer {}", token),
            Authentication::Basic { email, password } => {
                let credentials = format!("{}:{}", email, password);
                let encoded = base64::engine::general_purpose::STANDARD
                    .encode(credentials);
                format!("Basic {}", encoded)
            }
        }
    }
}

Verifying Your Token

You can verify your token works by fetching your own profile:
use rc_api::{Authentication, RcApiClient};

let auth = Authentication::Bearer(
    std::env::var("RECURSE_PAT")?
);
let client = RcApiClient::with_auth(auth)?;

// Fetch your profile
let my_profile = client.get_my_profile()?;
println!("Authenticated as: {}", my_profile.name);

Troubleshooting

This error occurs when the environment variable is not set. Make sure you’ve exported it:
export RECURSE_PAT="your_token_here"
Verify it’s set:
echo $RECURSE_PAT
This means your token is invalid or has expired. Generate a new token from your Recurse Center account settings.
The VCF generator supports .env files via the dotenv crate. Create a .env file in your project root:
RECURSE_PAT=your_token_here
The token will be automatically loaded when you run the program (see main.rs:311).
Never commit your .env file to version control! Add it to your .gitignore.

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

Build docs developers (and LLMs) love