Platform
Connect to CloudHike
Add a “Connect to CloudHike” button to your own platform. Your users sign in and click Allow; you get a token to create projects and deploy services for them.
How it works
Building an app builder, a no-code tool or an AI agent that needs a backend? Let your users bring their CloudHike.dev workspace. It works like “Sign in with GitHub”: you send the user to CloudHike.dev, they sign in and click Allow, and you get an access token. With it you call the MCP server or the REST API to create projects, deploy Postgres, Auth, Storage and more, and read the .env. Usage is billed to the user's workspace.
- Register your app in Settings → API & apps → Developer apps. You get a client ID and a client secret.
- Send the user to
https://cloudhike.dev/connect?client_id=…&redirect_uri=…&state=…. - They sign in (or sign up) and click Allow. We redirect to your
redirect_uriwith?code=…&state=…. - Your server exchanges the code for an access token at
POST https://cloudhike.dev/api/connect/token. - Call
https://cloudhike.dev/api/mcporhttps://cloudhike.dev/api/v1withAuthorization: Bearer <access_token>.
1. Register your app
In Settings → API & apps → Developer apps, click New app. Give it the name users see on the Allow screen and up to 5 callback URLs (https, or http on localhost for development). The redirect_uri you send must match one of them exactly. Copy the client secret when it is shown: it is only shown once. Keep it on your server.
3. Exchange the code (server side)
curl -X POST https://cloudhike.dev/api/connect/token \
-H "content-type: application/json" \
-d '{
"code": "CODE_FROM_CALLBACK",
"redirect_uri": "https://myapp.com/cloudhike/callback",
"client_id": "cha_xxx",
"client_secret": "chs_xxx"
}'{
"access_token": "ict_...",
"token_type": "bearer",
"mcp_url": "https://cloudhike.dev/api/mcp",
"api_url": "https://cloudhike.dev/api/v1"
}| Error | Meaning |
|---|---|
invalid_request (400) | A field is missing. |
invalid_client (401) | Unknown client ID or wrong secret. |
invalid_grant (400) | The code is unknown, expired, already used, or was issued for another app or redirect URI. |
4. Build the backend for your user
The access token works everywhere the workspace API key does. Give it to your agent as the MCP server's bearer token, or call the REST API directly:
# Create a project
curl -X POST https://cloudhike.dev/api/v1/projects \
-H "authorization: Bearer ict_..." -H "content-type: application/json" \
-d '{"name":"My mobile app"}'
# Add services, then read the .env to put into the generated app
curl -X POST https://cloudhike.dev/api/v1/projects/PROJECT_ID/services -H "authorization: Bearer ict_..." ...
curl https://cloudhike.dev/api/v1/projects/PROJECT_ID/env -H "authorization: Bearer ict_..."Each app has its own token per user. Connecting again replaces it. The user can disconnect your app at any time in Settings → API & apps → Connected apps; the token then returns 401 and you send them through /connect again.
Use with AI
Ask your AI editor to add a “Connect to CloudHike” button to your platform.
- 1
Open a terminal in your app's folder and start Claude Code.
claude - 2
Paste the prompt below and press Enter. Approve the file edits and commands it asks about.
- 3
Optional: save a short note about CloudHike.dev in CLAUDE.md so every session knows about it.
Add a “Connect to CloudHike” flow to this app following https://cloudhike.dev/docs/md/connect: a button that opens /connect with my client_id, a callback route that checks state and exchanges the code server-side at /api/connect/token, and store the access token per user to call https://cloudhike.dev/api/mcp.
Replace the placeholders in <angle brackets> before sending. Always review what the agent changes.
