Overview
The Onboarding API allows new users to quickly set up their portfolio by importing data from their GitHub profile. This process fetches repositories, profile information, and other relevant data.Onboarding endpoints require authentication. The user must be signed in with Clerk.
Start Onboarding
Initiate the onboarding process by importing GitHub data.Headers
Bearer token from Clerk authentication
Must be
application/jsonRequest Body
GitHub profile URL or usernameExamples:
https://github.com/johndoejohndoe
The authentication method used during sign-in
GITHUB- Signed in with GitHub OAuthGOOGLE- Signed in with Google OAuthEMAIL- Signed in with email/password
What Gets Imported
The onboarding process imports:-
Profile Information
- Name
- Bio
- Location
- Avatar/Profile image
- Follower/Following counts
- Website URL
-
Repositories
- Repository name and description
- Programming languages used
- Star and fork counts
- Topics/tags
- Creation and update dates
- Repository URL
-
GitHub Stats
- Total public repositories
- Account creation date
- Public gists
Response
true if onboarding succeeded, false otherwiseHuman-readable message describing the result
Example Request
Success Response
Status: 200 OKError Responses
Unauthorized
Status: 401 Unauthorized- No authentication token is provided
- The token is invalid or expired
Onboarding Failed
Status: 400 Bad Request- Invalid GitHub URL or username
- GitHub API rate limit exceeded
- GitHub profile not found
- Network connectivity issues
Internal Server Error
Status: 500 Internal Server ErrorOnboarding Status
After successful onboarding, the user’sonBoardingStatus field is set to true. This indicates that the user has completed the initial setup and their portfolio is ready.
You can check the onboarding status by fetching user data:
Authentication Type Storage
TheauthType parameter is stored in the user’s profile and can be one of:
GITHUB- User authenticated with GitHubGOOGLE- User authenticated with GoogleEMAIL- User authenticated with email/password
- Customize the user experience
- Determine available GitHub API access (OAuth users may have higher rate limits)
- Track sign-in methods for analytics
GitHub API Rate Limits
If rate limits are exceeded, the onboarding process will fail with an error message. Users should wait before retrying.Best Practices
Handle loading states
Handle loading states
Onboarding can take several seconds to complete. Show a loading indicator to users while the process is running.
Validate GitHub URL
Validate GitHub URL
Before sending the request, validate that the GitHub URL is in the correct format:
https://github.com/usernameusernameonly
Error handling
Error handling
Implement proper error handling for:
- Network failures
- Invalid GitHub profiles
- Rate limit errors
- Authentication issues
One-time process
One-time process
Onboarding should typically only be done once per user. Check
onBoardingStatus before initiating onboarding.After Onboarding
Once onboarding is complete:- User data is populated in the database
- Repositories are imported and can be managed via the Dashboard API
- User can customize their portfolio template
- User can add additional information (education, experience)