vercel-sdk-patterns
Execute apply production-ready Vercel SDK patterns for TypeScript and Python.\nUse when implementing Vercel integrations, refactoring SDK usage,\nor establishing team coding standards for Vercel.\nTrigger with phrases like \
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Execute apply production-ready Vercel SDK patterns for TypeScript and Python.\nUse when implementing Vercel integrations, refactoring SDK usage,\nor establishing team coding standards for Vercel.\nTrigger with phrases like \
How to use
Upewnij się, że masz ukończoną konfigurację z umiejętności vercel-install-auth oraz projekt TypeScript z włączonym trybem strict. Przygotuj token dostępu Vercel z odpowiednimi uprawnieniami.
Utwórz plik lib/vercel-client.ts i zdefiniuj interfejsy VercelClientConfig oraz VercelError. Klasa VercelClient powinna przechowywać token, opcjonalny teamId i baseUrl (domyślnie https://api.vercel.com).
Zaimplementuj prywatną metodę request
w klasie VercelClient, która konstruuje URL z parametrami teamId, ustawia nagłówki Authorization (Bearer token) i Content-Type, oraz obsługuje odpowiedzi HTTP. Dodaj metody publiczne dla typowych operacji API, takie jak getProjects(), getDeployments(projectId), getEnvironmentVariables(projectId) i setEnvironmentVariable(). Każda metoda powinna wywoływać request
z odpowiednią metodą HTTP i ścieżką. Wdróż obsługę błędów poprzez sprawdzenie pola error w odpowiedzi i rzucanie wyjątków z informacją o kodzie i wiadomości. Dodaj logikę ponawiania dla żądań, które mogą być tymczasowo niedostępne.
Wyzwól umiejętność frazami takimi jak "vercel SDK patterns", "vercel API wrapper", "vercel REST API client", "vercel best practices" lub "idiomatic vercel API", aby otrzymać kompletne implementacje i przykłady użycia dla Twojego projektu.