Build a Bio Page with Chatbot

Everything the SE team needs to replicate the Virtual Bruce setup — a personal portfolio site with an AI chatbot, API key secured in Delinea, deployed free on Cloudflare.

Claude Code Cloudflare Pages Delinea Platform Anthropic API SE Guide

Prerequisites

11 items

Everything you need before writing a single line of code. Badge colors indicate access requirements — admin, free, or paid.

Fast Track — let Claude Code handle it

Once Claude Code is installed, you don't need to run any of these commands yourself. Open a terminal, type claude to start a session, then paste this prompt — it will check what's installed and set up everything else for you:

Setup prompt — paste this into Claude Code
I'm setting up my machine to build a Cloudflare + Claude API project.

Please check whether each of the following tools is installed by running its
version command. For anything missing, install it — tell me what you're doing
at each step and pause if you need me to enter a password or authenticate.

Tools to check and install if missing:
1. Homebrew (Mac) — check with `brew --version`; if missing, give me the
   one-liner from brew.sh. Skip this step if I'm on Windows/WSL (use apt).
2. Node.js + npm — install via `brew install node` (Mac) or
   `sudo apt install -y nodejs npm` (WSL/Linux)
3. Git — install via Homebrew or apt if missing; then run
   `git config --global user.name` and `git config --global user.email`
   and configure them if they're blank (ask me for my name and email)
4. GitHub CLI — install via `brew install gh` (Mac) or
   `sudo apt install -y gh` (WSL/Linux); then run `gh auth login`
5. Wrangler CLI — install via `npm install -g wrangler`;
   then run `wrangler login` to authenticate with Cloudflare

Once everything is installed and authenticated, confirm what was already
present and what was newly installed.

Still manual: creating your Cloudflare, GitHub, and Anthropic accounts, getting your Anthropic API key, and setting up your Delinea service account — those require browser sign-ups and can't be scripted. The full checklist below covers each one.

Items marked Requires Admin may need IT approval or elevated rights on a managed Mac. Check with your IT team before starting — getting these unblocked first will save time.

Mac: Terminal is built in — just open it and you're ready.

Windows: Install WSL2 (Windows Subsystem for Linux). Open PowerShell as Administrator and run wsl --install, restart if prompted, then use the Ubuntu terminal for all commands going forward.

Built In (Mac) WSL2 (Windows)

Install this first — once it's running, it can handle most of the remaining setup for you via the Fast Track prompt below.

Install with the one-liner:

npm install -g @anthropic-ai/claude-code

Then type claude — it will open a browser tab to authenticate with your Anthropic account.

Free CLI Paid API Usage

macOS package manager — how you install Node.js, Git, and other tools. Install with a single command from the Homebrew website.

Windows/WSL: skip this — use apt inside your Ubuntu terminal instead.

Free Requires Admin (Mac)

JavaScript runtime required for Wrangler (Cloudflare CLI) and Claude Code. Install via Homebrew: brew install node

Free Requires Admin
Git

Version control and required for Cloudflare Pages auto-deploy from GitHub. Usually pre-installed on Mac; confirm with git --version or install via Homebrew.

Free

Cloudflare's developer CLI for deploying Workers and Pages projects locally and to production. Install via npm: npm install -g wrangler

Free

Required to connect your repo to Cloudflare Pages for automatic deploys on every git push.

  1. Go to github.com/signup
  2. Create a free account — pick a username you're happy with, it'll appear in your site URL
  3. Verify your email address
Free

Command-line tool for creating GitHub repos without leaving the terminal. The initial prompt uses it to create your repo and enable Pages in one shot. Install via Homebrew: brew install gh, then authenticate with gh auth login

Free

Hosts your site on Cloudflare Pages and runs the serverless Worker. The free tier covers everything — no credit card required.

  1. Go to dash.cloudflare.com/sign-up
  2. Create a free account with your work email
  3. No domain needed — Cloudflare gives you a free *.pages.dev subdomain
Free Tier

Powers the AI chatbot via Claude. Claude Haiku is extremely cost-effective — typically pennies per day of usage.

  1. Go to console.anthropic.com and create an account
  2. Go to Settings → Billing and add a payment method — a small amount like $5 will last weeks
  3. Go to Settings → API Keys and click Create Key
  4. Give it a name (e.g. my-bio-site), copy the key — it starts with sk-ant-
  5. Save it somewhere safe — you won't be able to see it again after closing the dialog
Paid Usage

You'll store the Anthropic API key here and have your site fetch it at runtime — the whole point of this demo.

  1. Log in to your Delinea instance at delinea.com (or your org's Secret Server URL)
  2. Confirm you can navigate to Secrets and create a new secret
  3. Confirm you have access to Admin → User Management to create a service account — if not, ask your SE manager
  4. Note your tenant URL (e.g. https://yourcompany.secretservercloud.com) — you'll need it later
Requires Admin

Setup Guide

Follow these steps in order. Estimated time: 2–3 hours for a first-time setup, depending on IT approvals for admin items.

Steps 1–4 are one-time machine setup. Steps 5–9 are per-project. Mac users: follow steps as written. Windows users: install WSL2 first, then use the Ubuntu terminal for all commands — Homebrew steps don't apply, use apt instead.
1

Install Homebrew (Mac) or set up WSL2 (Windows)

Mac: Run the one-liner from brew.sh. It will prompt for your Mac password — requires local admin rights. If your Mac is managed by IT, submit a ticket first. Once installed, run brew --version to confirm.

Windows: Open PowerShell as Administrator and run:

wsl --install

Restart when prompted. From here, do all remaining steps inside the Ubuntu terminal that WSL2 installs — not PowerShell.

2

Install Node.js and Git

With Homebrew installed, run:

brew install node git

Confirm with node --version, npm --version, and git --version. Node 18+ is required.

3

Install Wrangler and Claude Code

Both install as global npm packages:

npm install -g wrangler @anthropic-ai/claude-code

Confirm with wrangler --version and claude --version. If npm complains about permissions, your Node install may need a fix — see the npm docs on fixing permissions without sudo.

4

Create accounts: Cloudflare, GitHub, Anthropic

  • Cloudflare: Sign up at cloudflare.com (free). You'll use this for Pages hosting and Workers.
  • GitHub: Sign up at github.com (free). Create a new empty repository for your portfolio site.
  • Anthropic: Sign up at console.anthropic.com. Add a payment method and generate an API key. Keep this key — you'll vault it in the next steps. Claude Haiku usage costs a fraction of a cent per conversation.
5

Store the Anthropic API key in Delinea

Log in to your Delinea instance and create a new secret to store the Anthropic API key:

  • Navigate to Secrets and create a new secret using the Generic Username/Password or API Key template.
  • Set the name (e.g., Anthropic API Key – [Your Name]), paste the API key into the password field.
  • Note the Secret ID from the URL — you'll reference this in your Worker config.
6

Create a Delinea service account

Your Cloudflare Worker needs to authenticate to Delinea at runtime to fetch the key. Create a dedicated service account for this:

  • In Delinea, go to Admin → User Management and create a new local user (e.g., svc-chatbot-[yourname]).
  • Assign the service account only the permissions it needs: View access to the specific secret you created in step 5. Principle of least privilege.
  • Enable OAuth Client Credentials for this account and note the Client ID and Client Secret — these go into your Cloudflare Worker as environment secrets.
  • Also note your Delinea tenant URL (e.g., https://yourcompany.secretservercloud.com).
7

Build your portfolio site with Claude Code

This is the fun part. Clone the source code from Bruce's repo (or start fresh) and use Claude Code to build out your own version:

claude

Describe what you want — your background, the chatbot persona, the design — and Claude Code will write the HTML, CSS, JS, and Cloudflare Worker code. The Worker handles fetching your API key from Delinea at runtime so it's never hardcoded in your source.

8

Add your secrets in the Cloudflare dashboard

Never put secrets in your code, a .env file, or anywhere that gets committed to git. Cloudflare stores them encrypted at rest, injects them into your Worker at runtime only, and never exposes them in logs or source. Once saved, the value is not shown again — not even to you.

In the Cloudflare dashboard, navigate to:

Workers & Pages → your project → Settings → Variables and Secrets

Click Add variable for each one below. For every entry, set the type to Secret — this encrypts the value so it can never be read back out of the UI. Copy each variable name with the button, paste it into the Variable name field, then paste your value into the Value field.

DELINEA_CLIENT_ID
OAuth client ID for your Delinea service account (from step 6)
DELINEA_CLIENT_SECRET
OAuth client secret for your Delinea service account (from step 6)
DELINEA_SECRET_ID
Numeric ID of the Anthropic API key secret in Delinea (from step 5)
DELINEA_BASE_URL
Your Delinea tenant URL, e.g. https://yourcompany.secretservercloud.com

Click Save and deploy when done. Your Worker can now read these values at runtime without them ever touching your codebase.

9

Connect GitHub to Cloudflare Pages and deploy

Push your code to GitHub, then in the Cloudflare dashboard:

  • Go to Workers & Pages → Create → Pages → Connect to Git.
  • Select your GitHub repo, set the build output directory (e.g., public/ or root), and deploy.
  • Every future git push to your main branch automatically redeploys — no manual steps needed.

Workshop Prompts

4 prompts

Copy these prompts into Claude Code exactly as written — just swap the [bracketed placeholders] for your own details. Run them in order.

Prompt 1 — Build the bio page
I want to build a personal "link in bio" page and deploy it to GitHub Pages.

My details:
- Name: [Your Name]
- Title: [Your Title at Delinea]
- A short tagline or bio: [e.g. "Bridging the gap between cybersecurity and business — one demo at a time"]
- Links to include:
  - Calendar: [Your booking URL]
  - LinkedIn: [Your LinkedIn URL]
  - Company website: https://delinea.com

Please:
1. Create a clean, modern single-page HTML/CSS site with my info and links
2. Include Delinea company logo branding on the page (pull the logo from delinea.com)
3. Initialize a git repo
4. Create a GitHub repo named [your-github-username].github.io using the GitHub CLI
5. Push the code to main
6. Enable GitHub Pages on the repo
Prompt 2 — Dark mode, animations & polish
Now let's enhance the site with the following improvements:

1. Dark/light mode toggle button that switches between themes and
   remembers the user's preference
2. Animated entrances for all elements on page load (fade or slide in)
3. Hover effects on all link cards (lift effect, subtle color/shadow change)
4. A favicon and descriptive page title that reflects my name and role
   - Important: create the favicon as a separate SVG file (e.g. favicon.svg)
     rather than an inline data URI — inline SVG favicons often render as
     a black square in browsers.

Make sure everything still looks clean and cohesive after these changes.
Prompt 3 — Visitor counter (advanced)
Let's add a live page view counter to the site using Cloudflare Workers KV.

1. Create a Cloudflare Worker that increments and returns a visit count
   stored in KV on each page load
2. Add a KV namespace binding to wrangler.toml
3. Display the count on the page in a subtle, styled way
4. Make sure the counter works in both dev (wrangler pages dev) and
   production (Cloudflare Pages)
Prompt 4 — Add the AI chatbot
Let's add an AI chatbot to the site that acts as a virtual version of me.
The chatbot should use the Anthropic Claude API (claude-haiku-4-5), and the
API key must never appear in source code — it gets fetched at runtime from
Delinea Secret Server using OAuth2 client credentials.

Here's what I need:

**1. Cloudflare Pages Function — functions/api/chat.js**
- POST endpoint that accepts { messages: [{role, content}] }
- Rate limit to 10 requests per minute per IP
- On each request:
  a. Use DELINEA_CLIENT_ID and DELINEA_CLIENT_SECRET (from env) to get an
     OAuth2 bearer token from:
     https://[DELINEA_TENANT].secretservercloud.com/oauth2/token
  b. Use that token to fetch the Anthropic API key from Secret Server:
     GET https://[DELINEA_TENANT].secretservercloud.com/api/v2/secrets/[DELINEA_SECRET_ID]/fields/password
  c. Call the Anthropic Messages API with Claude Haiku and the system prompt below
  d. Return { reply: "..." } as JSON

**2. System prompt — make it personal**
Write a system prompt that instructs the AI to BE me in first person, not
describe me in third person. Include:
- My name: [Your Name]
- My role: [Your Title at Delinea]
- My background: [2-3 sentences about your experience and what you work on]
- How I talk: direct, no corporate fluff, explain technical things simply
- What I can discuss: my background, PAM/cybersecurity topics, what it's
  like to work with me
- Always point people to book a real conversation for deep dives

**3. Chat widget — floating button + slide-up panel**
- Fixed position, bottom-right corner of the page
- Chat bubble button that opens/closes the panel
- Panel shows conversation history, a text input, and a send button
- Show a typing indicator ("...") while waiting for the AI response
- Handle errors gracefully with a user-facing message
- Style it to match the site's existing dark theme and color palette

**4. wrangler.toml**
Add the required KV namespace binding for CHAT_LOGS (create the KV namespace
via wrangler if it doesn't exist) so chat interactions are logged.

**5. Environment variables needed in Cloudflare Pages Settings → Variables and Secrets:**
- DELINEA_CLIENT_ID (Secret)
- DELINEA_CLIENT_SECRET (Secret)
- DELINEA_TENANT (Plain text — just the subdomain, e.g. mycompany)
- DELINEA_SECRET_ID (Plain text — the numeric ID of the secret in Delinea)

These are already set in Cloudflare from step 8 of the setup guide — the
Worker just needs to read them from env.

After wiring this up, test it locally with:
  wrangler pages dev . --binding DELINEA_CLIENT_ID=test

The goal is a working chatbot where a visitor can ask questions and get
responses that feel like they're talking to me — and where the API key is
demonstrated as a live runtime secret fetch, never hardcoded.

Architecture

How the pieces connect at runtime — browser to Cloudflare to Delinea to Claude.

Visitor Browser
        |
        |  Static HTML / CSS / JS  (your portfolio)
        v
Cloudflare Pages  (free hosting, auto-deploy from GitHub)
        |
        |  POST /api/chat  (chat message from visitor)
        v
Cloudflare Worker  (your serverless backend — never touches a server)
  ├── Delinea OAuth2     client_credentials → bearer token
  ├── Delinea Secret     fetch Anthropic API key from vault at runtime
  └── Anthropic API      Claude with your custom persona system prompt
        |
        v
Chat Response  → streamed back to the visitor's browser

Key point: the Anthropic API key is NEVER in your source code.
It lives in Delinea and is only fetched at Worker runtime — a live
demo of the runtime secret injection pattern you already sell.