
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
dev-portfolio-chatbot
Advanced tools
An AI-powered chatbot for developers’ portfolio websites. It uses Google Gemini API to answer questions about the developer dynamically from live GitHub data and personalized info.
portfolio_config.js on install.npm install dev-portfolio-chatbot
After installation, a
portfolio_config.jsfile is automatically generated in your project root. You can edit it to provide your info.
The generated portfolio_config.js looks like this:
const API_URL = "api_endpoint_here";
const MODEL_NAME = "gemini-2.5-flash-lite";
const MODEL_TONE = "default"; // professional, funny, polite, friendly, moody, or default
const GITHUB_USER = "your_github_username";
// add more info if you want
const PERSONAL_INFO = {
name: "Your Name",
title: "Your Title",
experience: "X years",
location: "Your Location",
skills: ["Skill1", "Skill2"],
education: "Your Education",
contact: "your_email@example.com",
bio: "Your bio here",
interests: ["Interest1", "Interest2"],
};
export const portfolio_config = {
apiUrl: API_URL,
model: MODEL_NAME,
tone: MODEL_TONE,
personalInfo: PERSONAL_INFO,
githubUser: GITHUB_USER,
};
Gemini API keys cannot be exposed on the client side for security reasons. You need a server to proxy requests. Here are two options:
Use a serverless function to handle API calls. If deploying on Vercel, files in /api/ are treated as serverless functions.
Add your Gemini API key as an environment variable GEMINI_API_KEY.
In portfolio_config.js, set API_URL to your deployed endpoint:
const API_URL = "https://your-site.vercel.app/api/ai";
Example
/api/ai.ts(compatible with Vercel Edge Functions or Next.js API routes):
This repo also uses this option. See here
If you can not use option 1 and prefer having a full backend, you can use an Express server. A ready-to-use example is available in this companion repo: dev-portfolio-chatbot-backend.
You can also deploy it to Vercel with a single click:
Steps to get started:
GEMINI_API_KEY in Vercel’s environment variables.portfolio_config.js, set API_URL to your deployed backend URL (e.g., https://your_deployed_vercel.vercel.app/api/ai).Now your backend will handle API requests securely, keeping your Gemini API key protected.
Note: without env variable, it will return 500. Don't forget to redeploy after adding the env variable.
The chatbot can automatically adjust its position based on the presence of header and footer elements.
id="header".id="footer".This allows the chatbot to avoid overlapping with your main layout.
| Prop | Available Options | Default | Description |
|---|---|---|---|
position | "right-bottom" | "left-bottom" | "right-top" | "left-top" | "right-bottom" | Position of the widget on the page |
size | "small" | "medium" | "large" | "medium" | Size of the chat window |
config | Config | required | Configuration object for the chatbot |
This chatbot is framework-agnostic and works everywhere. Here are some example setups to get started:
import { ChatbotWidget } from "dev-portfolio-chatbot";
import { portfolio_config } from "../portfolio_config"; // adjust path if needed
function App() {
return (
<>
<h1>React Example</h1>
<ChatbotWidget config={portfolio_config} />
</>
);
}
export default App;
src/index.html:<script
type="module"
src="https://cdn.jsdelivr.net/npm/dev-portfolio-chatbot/dist/vanilla/chatbot-widget.vanilla.js"
></script>
<chatbot-widget
id="chatbot"
position="right-bottom"
size="medium"
></chatbot-widget>
import { Component, NgZone, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
import { portfolio_config } from "../../portfolio_config.js";
@Component({
selector: "app-root",
templateUrl: "./app.html",
styleUrls: ["./app.css"],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class App {
constructor(private ngZone: NgZone) {
this.ngZone.onStable.subscribe(() => {
const chatbot = document.getElementById("chatbot") as any;
if (chatbot && !chatbot.config) {
chatbot.config = portfolio_config;
}
});
}
}
<script
type="module"
src="https://cdn.jsdelivr.net/npm/dev-portfolio-chatbot/dist/vanilla/chatbot-widget.vanilla.js"
></script>
<template>
<chatbot-widget id="bot"></chatbot-widget>
</template>
<script setup>
import { onMounted } from "vue";
import { portfolio_config } from "../portfolio_config.js";
onMounted(() => {
const bot = document.getElementById("bot");
if (bot) bot.config = portfolio_config;
});
</script>
<chatbot-widget
id="chatbot"
position="right-bottom"
size="medium"
></chatbot-widget>
<script
type="module"
src="https://cdn.jsdelivr.net/npm/dev-portfolio-chatbot/dist/vanilla/chatbot-widget.vanilla.js"
></script>
<script type="module">
import { portfolio_config } from "./portfolio_config.js";
const chatbot = document.getElementById("chatbot");
chatbot.config = portfolio_config;
</script>
These examples demonstrate the flexibility of the chatbot. You can adapt the same approach for other frameworks or vanilla JS setups by referring to these samples.
For most dev-portfolio-chatbot setups, these free tiers are sufficient. If your site has high traffic, consider upgrading your Gemini API plan and using GitHub tokens for higher request limits.
Since this chatbot fetches data directly from GitHub public repositories, adding more information there improves its responses. Make sure your repositories have detailed:
README.md filesThe richer the GitHub data, the better the chatbot can answer questions about your portfolio.
FAQs
An AI-powered chatbot for developers portfolio websites
We found that dev-portfolio-chatbot demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.