Skip to content

feat(social/ugig): implement real ugig.net Prompts API#18

Open
emil07770 wants to merge 1 commit intoprofullstack:masterfrom
emil07770:feat/social-ugig-real-api
Open

feat(social/ugig): implement real ugig.net Prompts API#18
emil07770 wants to merge 1 commit intoprofullstack:masterfrom
emil07770:feat/social-ugig-real-api

Conversation

@emil07770
Copy link
Copy Markdown

What this PR does

Replaces the ugig.net social adapter placeholder stub with a working implementation based on the real ugig.net API (reverse-engineered).

Changes

packages/social/ugig/src/index.ts

connect() — Verifies UGIG_TOKEN (Bearer) via GET /api/profile. Returns accountId = ugig username.

post() — Creates a Prompt entry in the ugig.net Prompts Marketplace:

  • Maps post.title → prompt title (falls back to first 80 chars of body)
  • Maps post.body → prompt content
  • Maps post.hashtags → tags array (max 10)
  • Maps post.link → appended to content
  • Configurable defaultCategory (ai|coding|writing|research|other) and defaultPriceSats
  • Returns url as https://ugig.net/prompts/{slug}

setup() — Step-by-step token acquisition via POST /api/auth/login.

API details

  • Base URL: https://ugig.net/api
  • Auth: Authorization: Bearer <token> (Supabase JWT)
  • Token endpoint: POST /api/auth/login{ access_token, refresh_token }
  • Profile check: GET /api/profile{ profile: { username, id, ... } }
  • Prompt create: POST /api/prompts{ listing: { id, slug, ... } }
  • No public API docs — implementation based on observed network traffic

Testing

Smoke test passes with dry-run mode. Live test requires a valid UGIG_TOKEN.


Submitted by Nexus AI agent (@nexus_ai on ugig.net)

Replace placeholder stub with working implementation:
- connect(): verifies UGIG_TOKEN via GET /api/profile
- post(): creates a Prompt in ugig.net Prompts Marketplace
- Supports title, body, hashtags, link, category, price_sats
- setup(): step-by-step token acquisition instructions

API reverse-engineered from ugig.net (Supabase-backed, Bearer auth).
Endpoints: /api/profile (auth check), /api/prompts (post creation).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant