🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@ridit/hackclub-ai-sdk

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ridit/hackclub-ai-sdk - npm Package Compare versions

Comparing version
0.1.2
to
0.1.3
+1
.env
HACKCLUB_API_KEY=sk-hc-v1-da2f4f78f93d4e1ab755eb9b1f73e3f4d7ab6e0c7072499c9e80da45bb8dbe00

Sorry, the diff of this file is too big to display

@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Geist+Mono:wght@100..900&family=Google+Sans+Code:ital,wght@0,300..800;1,300..800&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
body {
font-family: "Inter", sans-serif;
font-optical-sizing: auto;
font-style: normal;
background: #101010;
padding: 0 80px;
}
body nav {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px;
color: #fff;
}
body nav span {
font-family: "Google Sans Code", monospace;
font-size: 20px;
cursor: pointer;
}
body nav span:hover {
text-decoration: underline;
}
body nav ul {
display: flex;
list-style: none;
gap: 16px;
}
body nav ul li {
font-family: "Google Sans Code", monospace;
font-optical-sizing: auto;
cursor: pointer;
font-size: 18px;
}
body nav ul li:hover {
color: #f5f5f5;
text-decoration: underline;
}
body nav button {
background: white;
color: black;
border-radius: 24px;
font-family: "Geist Mono", monospace;
font-size: 19px;
padding: 6px 20px;
cursor: pointer;
transition: background 0.2s ease-in-out;
}
body nav button:hover {
background: #f5f5f5;
}
body main {
padding-top: 3rem;
/* padding-inline: px; */
}
body main .card {
display: flex;
flex-direction: column;
/* align-items: center; */
justify-content: center;
gap: 6px;
cursor: pointer;
padding: 2rem;
border-radius: 14px;
transition: background 0.2s ease-in-out;
}
body main .card:hover {
background: #1a1a1a;
}
body main .card .image {
display: flex;
align-items: center;
justify-content: center;
padding: 20px 0;
background: #212121;
border-radius: 14px;
position: relative;
}
body main .card .image img {
width: 400px;
height: auto;
margin-top: 2.4rem;
}
body main .card .image .status {
position: absolute;
top: 15px;
left: 15px;
background: #bef3c6;
padding: 4px 8px;
border-radius: 6px;
font-size: 14px;
}
body main .card .details {
color: white;
font-family: "Poppins", sans-serif;
}
body main .card .details p {
font-size: 20px;
font-weight: 500;
}
body main .card .details .tags {
display: flex;
gap: 1.2rem;
}
body main .card .details .tags span {
background: #ffd69e;
color: black;
padding: 1px 8px;
border-radius: 700px;
}
body main .card .details .tags span:nth-child(2) {
background: #f8bbb9;
}
body main .details:first-child {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 3rem;
background: #1a1a1a;
border-radius: 4rem;
padding: 0 2rem;
}
body main .details:first-child span {
color: white;
font-family: "Poppins", sans-serif;
font-size: 6rem;
}
body main .projects-text {
color: white;
font-family: "Geist Mono", monospace;
font-size: 3.5rem;
text-decoration: underline;
}
body main .projects {
display: grid;
grid-template-columns: repeat(3, 1fr);
/* gap: 4rem; */
}
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<nav>
<span>GABIN TAVERNIER</span>
<ul>
<li>Projects</li>
<li>About</li>
<li>Skills</li>
</ul>
<button>Contact</button>
</nav>
<main>
<div class="details">
<span>Hi i'm <br />Gabin Taverneir</span>
<img src="https://gabintavernier.com/hackpad.png" />
</div>
<span class="projects-text">Projects</span>
<div class="projects" style="margin-top: 2rem">
<div class="card">
<div class="image">
<span class="status">✓ Completed</span>
<img src="https://gabintavernier.com/sprig.png" alt="" />
</div>
<div class="details">
<p>Remote Control Plan</p>
<div class="tags">
<span>RC Electronics</span>
<span>Aerodynamics</span>
</div>
</div>
</div>
<div class="card">
<div class="image">
<span class="status">✓ Completed</span>
<img src="https://gabintavernier.com/sprig.png" alt="" />
</div>
<div class="details">
<p>Remote Control Plan</p>
<div class="tags">
<span>RC Electronics</span>
<span>Aerodynamics</span>
</div>
</div>
</div>
<div class="card">
<div class="image">
<span class="status">✓ Completed</span>
<img src="https://gabintavernier.com/sprig.png" alt="" />
</div>
<div class="details">
<p>Remote Control Plan</p>
<div class="tags">
<span>RC Electronics</span>
<span>Aerodynamics</span>
</div>
</div>
</div>
</div>
</main>
</body>
</html>
+2
-1
{
"name": "@ridit/hackclub-ai-sdk",
"version": "0.1.2",
"version": "0.1.3",
"description": "One key. Every model. Hack Club powered.",

@@ -29,2 +29,3 @@ "author": "Ridit Jangra <riditjangra09@gmail.com> (https://ridit.space)",

"@openrouter/ai-sdk-provider": "^2.5.1",
"@ridit/hackclub-ai-sdk": "^0.1.2",
"ai": "^6.0.158",

@@ -31,0 +32,0 @@ "replicate": "^1.4.0"

@@ -28,3 +28,4 @@ {

"noPropertyAccessFromIndexSignature": false
}
},
"exclude": ["node_modules", "examples"]
}
# @ridit/hackclub-ai-sdk - Project Context
## 1. Project Overview
TypeScript SDK for the [Hack Club AI](https://ai.hackclub.com) API — free AI credits for hackers. Provides text and image generation via a clean, type-safe interface. Wraps OpenRouter and Replicate APIs with Hack Club's proxy endpoints.
## 2. Tech Stack
- **Language**: TypeScript (strict mode)
- **Runtime**: Bun (Node.js compatible)
- **Core SDKs**: `ai` (Vercel AI SDK), `@openrouter/ai-sdk-provider`, `replicate`
- **Build tool**: Bun build
- **Target**: Node.js (ES modules)
## 3. Package Manager
**Bun** — install/run commands:
```bash
bun add @ridit/hackclub-ai-sdk # install package
bun install # install deps
bun run build # build to dist/
bun run typecheck # type check
bun run prepublishOnly # pre-publish checks
```
## 4. Platform
Running on **win32** — no platform-specific code. Uses `fs` module for file saving (image generation).
## 5. Build & Dev Commands
- `bun run build` → Builds to `dist/` with bun
- `bun run typecheck` → TypeScript check only
- `bun run prepublishOnly` → Type check + build
## 6. Project Structure
```
src/
├── index.ts # Main exports
├── provider.ts # HackclubProvider class (main)
├── test.ts # Tests
├── types/
│ └── types.ts # Type definitions (currently empty)
└── utils/
├── models.ts # Model arrays and types
└── url.ts # Base URL constants
```
## 7. Code Style
- **Imports**: ES modules, named exports preferred
- **Formatting**: No formatter config found — likely Bun's built-in
- **TypeScript**: Strict mode, `noEmit: true`, bundler resolution
- **Naming**: PascalCase classes, camelCase variables/functions, kebab-case for aspect ratios
- **Error handling**: Try/catch in generateImage for fetch failures, console.log for save notifications
- **Types**: Const assertion for model arrays (`as const`), derived union types
## 8. Architecture Notes
- **Provider pattern**: Single `HackclubProvider` class with `generateText` and `generateImage` methods
- **API integration**: Uses OpenRouter provider for text, direct fetch for image generation
- **Model management**: Centralized model lists in `utils/models.ts` with type-safe string unions
- **Image handling**: Base64 data URL parsing, optional auto-save to disk with custom filenames
- **Configuration**: Environment variable `API_KEY` required, base URLs in constants