Developer Documentation
Everything you need to integrate and build with CodeHut
Create Your Account
Sign up for a free CodeHut account to get started
Get Your API Key
Generate an API key from your dashboard settings
// Set your API key as an environment variable
export CODEHUT_API_KEY="your_api_key_here"Make Your First Request
Test the API with a simple snippet retrieval
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.codehut.com/snippetsUpload Your First Snippet
Create and share your first code snippet
const snippet = await createSnippet({
title: "Hello World",
code: "console.log('Hello, CodeHut!')",
language: "javascript"
})CodeHut is a powerful platform for managing, sharing, and organizing your code snippets. Whether you're a solo developer or part of a team, CodeHut helps you save time by making your most useful code easily accessible and searchable.
- Store and organize code snippets in multiple programming languages
- Advanced search and filtering capabilities
- Team collaboration and sharing features
- API access for integration with your development workflow
- VS Code extension for seamless integration
Coming Soon: The VS Code extension is currently in development.Learn more about the roadmap →
Install the CodeHut VS Code extension from the marketplace:
ext install codehut.codehut-vscodeCreating Your First Snippet
Click the "Upload" button in the navigation or press Ctrl+U to create your first code snippet. Add a descriptive title, select the programming language, and paste your code.
Organizing with Tags
Use tags to categorize your snippets. Tags like "react", "utility", "api" help you find your code quickly later.
CodeHut uses API keys for authentication. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEYGet your API key from your account settings page.
GET /api/snippets
Retrieve all your snippets with optional filtering
POST /api/snippets
Create a new code snippet
GET /api/snippets/{id}
Get a specific snippet by ID
GET /api/user/profile
Get current user profile information
PUT /api/user/profile
Update user profile settings
GET /api/search
Search across all your snippets with advanced filters
GET /api/search?q=react&language=javascript&tags=componentIn Development: The VS Code extension is being actively developed.View development roadmap →
The CodeHut VS Code extension will allow you to:
- Save code snippets directly from your editor
- Search and insert snippets while coding
- Browse your snippet library in the sidebar
- Sync snippets across devices
Coming Soon: The CLI tool is in planning phase.Check the roadmap →
The CodeHut CLI will enable automation and scripting:
codehut search "react hooks"codehut upload ./component.js --title "My Component"codehut syncSet up webhooks to receive notifications when snippets are created, updated, or deleted:
{
"event": "snippet.created",
"data": {
"id": "snippet-123",
"title": "New React Hook",
"language": "javascript"
}
}CodeHut integrates with popular development tools:
- GitHub - Sync snippets with gists
- Slack - Share snippets in team channels
- Discord - Bot for snippet sharing
- Notion - Import snippets into documentation
Writing Good Snippet Titles
Use descriptive titles that clearly indicate what the code does. "React Custom Hook for API Calls" is better than "Hook".
Effective Tagging
Use consistent, lowercase tags. Include the language, framework, and purpose.
Organize your snippets using:
- Collections for related snippets
- Consistent tagging conventions
- Clear descriptions and comments
- Regular cleanup of outdated code
CodeHut supports team collaboration through:
- Team workspaces with shared access
- Permission controls for snippet visibility
- Comment and review system
- Activity feeds for team updates
Security best practices:
- Never store API keys or passwords in snippets
- Use private snippets for sensitive code
- Regularly review public snippet permissions
- Enable two-factor authentication