@vennyx/solipen-sdk
v0.1.0
Published
TR: SoliPen (Penpot 2.17 self-host) RPC API'si icin sifir bagimlilikli TypeScript SDK. EN: Zero-dependency TypeScript SDK for the SoliPen (self-hosted Penpot 2.17) RPC API.
Downloads
143
Readme
@vennyx/solipen-sdk
TR: SoliPen (self-host Penpot 2.17, https://app.solipen.com) RPC API'si için sıfır bağımlılıklı TypeScript SDK. EN: Zero-dependency TypeScript SDK for the SoliPen (self-hosted Penpot 2.17) RPC API.
Türkçe
Kurulum
npm install @vennyx/solipen-sdkNode >= 20 gerekir (global fetch kullanılır). ESM + CJS + tip tanımları birlikte gelir.
Access token alma
- https://app.solipen.com adresinde oturum açın.
- Sağ üstteki profil menüsünden Settings → Access tokens sayfasına gidin.
- Generate new token ile bir token oluşturun ve güvenli bir yerde saklayın (token yalnızca oluşturulduğu anda gösterilir).
Hızlı başlangıç
import { SoliPenClient } from '@vennyx/solipen-sdk';
const client = new SoliPenClient({
// baseUri varsayılanı: https://app.solipen.com
accessToken: process.env.SOLIPEN_ACCESS_TOKEN!,
});
const teams = await client.getTeams();
const projects = await client.getProjects(teams[0]!.id);
const files = await client.getProjectFiles(projects[0]!.id);
// Tipli metodu olmayan komutlar için jenerik rpc() — 145 komut adı autocomplete ile gelir:
const members = await client.rpc('get-team-members', { teamId: teams[0]!.id });Hatalar SoliPenApiError olarak fırlatılır (status, command, sunucudan gelen
type / code / hint alanlarıyla).
Komut listesini yenileme
src/commands.ts OpenAPI şemasından üretilir; instance yükseltmelerinden sonra:
npm run generate # https://app.solipen.com/api/main/doc/openapi.json okurEnglish
Install
npm install @vennyx/solipen-sdkRequires Node >= 20 (uses global fetch). Ships ESM + CJS + type definitions.
Getting an access token
- Sign in at https://app.solipen.com.
- Open the profile menu (top right) and go to Settings → Access tokens.
- Click Generate new token and store it safely (the token is only shown once).
Quick start
import { SoliPenClient } from '@vennyx/solipen-sdk';
const client = new SoliPenClient({ accessToken: process.env.SOLIPEN_ACCESS_TOKEN! });
const teams = await client.getTeams();
const projects = await client.getProjects(teams[0]!.id);
// Generic escape hatch with autocomplete over all 145 RPC commands:
const members = await client.rpc('get-team-members', { teamId: teams[0]!.id });Failures throw SoliPenApiError carrying status, command and the server's
type / code / hint fields. Regenerate the command union from the live
OpenAPI schema with npm run generate.
