From tradera-api
Obtain a Tradera user token by opening a browser login flow and polling for the resulting token. Use when the user needs to authenticate with Tradera to get a user token for API operations like publishing or deleting listings.
How this skill is triggered — by the user, by Claude, or both
Slash command
/tradera-api:tradera-user-tokenThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Obtains a user token through Tradera's token-login browser flow.
Obtains a user token through Tradera's token-login browser flow.
This skill needs appId, appKey, publicKey, and userId. They can be provided via environment variables (recommended) or as arguments.
Environment variables (recommended):
TRADERA_APP_ID — Tradera API application IDTRADERA_APP_KEY — Tradera API application key (secret — used for FetchToken call)TRADERA_PUBLIC_KEY — Tradera API public key (less sensitive — used in browser login URL)TRADERA_USER_ID — Tradera user IDAs arguments: /tradera-user-token <appId> <appKey> <publicKey> <userId>
Each Tradera API application has three credentials: Application ID, App Key, and Public Key. The public key is safe to expose in browser URLs.
Before making any API calls, resolve credentials in this order:
[ -n "$TRADERA_APP_ID" ] && [ -n "$TRADERA_APP_KEY" ] && [ -n "$TRADERA_PUBLIC_KEY" ] && [ -n "$TRADERA_USER_ID" ] (do NOT echo secrets)Generate a random UUID to use as the session secret:
SKEY=$(uuidgen | tr '[:upper:]' '[:lower:]')
echo "Secret key: $SKEY"
The skey is a single-use session secret used to fetch the token after login.
Open the Tradera token-login page in the user's browser. The pkey parameter is the application's public key (NOT the app key):
URL="https://api.tradera.com/token-login?appId={appId}&pkey={publicKey}&skey=$SKEY"
if command -v xdg-open &>/dev/null; then xdg-open "$URL"
elif command -v open &>/dev/null; then open "$URL"
elif command -v wslview &>/dev/null; then wslview "$URL"
else echo "Please open this URL manually: $URL"
fi
Tell the user:
A browser window has opened. Please log in to Tradera and authorize the application. Come back here and tell me when you're done.
Wait until the user confirms they have completed the login in the browser. Do NOT poll before they confirm.
Once the user confirms, call the FetchToken endpoint:
curl -s -w "\n%{http_code}" \
-X POST \
-H "Content-Type: application/json" \
-H "X-App-Id: {appId}" \
-H "X-App-Key: {appKey}" \
-d "{\"userId\": {userId}, \"secretKey\": \"$SKEY\"}" \
"https://api.tradera.com/v4/auth/token"
The response contains:
authToken — the user token stringhardExpirationTime — when the token expires (ISO 8601 datetime)If a userId is returned (from SOAP), include that too.
Present to the user:
## Tradera User Token
**User ID:** {userId}
**Token:** {authToken}
**Expires:** {hardExpirationTime}
You can now use these credentials with other Tradera skills:
/tradera-publish {appId} {appKey} {userId} {authToken}
/tradera-end-listing <itemId> {appId} {appKey} {userId} {authToken}
Important: Tell the user to store the token securely. It grants API access to their account until it expires.
npx claudepluginhub tradera/ai-marketplace --plugin tradera-apiCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.