Logo di Api Connection

Api Connection

Organizzazione
rejot-dev
api-connection

Configura e usa le connessioni API di Backoffice. Usalo per creare integrazioni API HTTP in uscita, configurare l’autenticazione OAuth o bearer, avviare flussi OAuth API, controllare lo stato dell’autenticazione o eseguire richieste API autenticate dalle automazioni.

Add to TypingMind

Panoramica

Pubblicato darejot-dev
Repositoryfragno
Nome della skillapi-connection
Stelle
62
Fork
6
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da rejot-dev su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Api Connection in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/rejot-dev/fragno/tree/main/apps/backoffice/content/static/skills/api-connection
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/rejot-dev/fragno.git /tmp/fragno
mkdir -p .claude/skills
cp -r /tmp/fragno/apps/backoffice/content/static/skills/api-connection .claude/skills/api-connection
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Api Connection in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Api Connection non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Api Connection non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

API Connection

Use this skill for scope-aware outbound HTTP API connections, OAuth PKCE authentication, bearer tokens, client credentials, and API requests through Backoffice runtimes.

API configuration

The API capability is available automatically for the current scope. Create each external API connection with a stable lowercase slug and a base URL.

  • Use api.* methods for API connections.
  • Register the public OAuth callback route /api/http/:scope/oauth/callback for scoped OAuth connections.
  • Use relative request paths, for example /v1/customers. If the user gives https://example.com/v1/customers and the connection base URL is https://example.com, call api.request with path: "/v1/customers".
  • Let stored connection auth replace caller-provided Authorization headers.
  • If the user supplies a client secret in the session and asks you to configure the connection, pass it to api.createConnection and keep the final response secret-free.

Rules:

  • When configuring a new OAuth connection, ALWAYS immediately start OAuth and give the user the returned authorizationUrl in a clickable way.
  • When the user says anything after you've presented them with the link, ALWAYS check status of the connection and report back to the user.

Typical OAuth setup flow:

  1. Create the API connection with the requested auth configuration.
  2. For OAuth connections, immediately start OAuth after creating the connection and give the returned authorization URL to the user:
js
const connection = await api.createConnection({
  slug: "example-api",
  name: "Example API",
  baseUrl: "https://api.example.com",
  auth: {
    type: "oauth",
    authorizationEndpoint: "https://api.example.com/oauth/authorize",
    tokenEndpoint: "https://api.example.com/oauth/token",
    clientId: "example-client",
    clientSecret: "example-client-secret",
    scopes: ["profile", "email", "read"],
    tokenEndpointAuthMethod: "client_secret_post",
  },
});

const oauth = await api.startOAuth({ slug: connection.slug });
return { connection, authorizationUrl: oauth.authorizationUrl };
  1. When the user responds after opening the OAuth URL, always check authentication status:
js
const status = await api.getAuthStatus({ slug: "example-api" });
return status;
  1. If authentication is successful, tell the user the connection is authenticated and ask whether they want to try an API call.
  2. When the user wants to test an API call, call api.request with a relative path and include Accept: "application/json" for JSON APIs.

Bearer setup example:

js
await api.createConnection({
  slug: "stripe",
  name: "Stripe",
  baseUrl: "https://api.stripe.com",
  auth: { type: "bearer", token: process.env.STRIPE_TOKEN },
});

OAuth setup example for a confidential server-side client:

js
await api.createConnection({
  slug: "example-api",
  name: "Example API",
  baseUrl: "https://api.example.com",
  auth: {
    type: "oauth",
    authorizationEndpoint: "https://api.example.com/oauth/authorize",
    tokenEndpoint: "https://api.example.com/oauth/token",
    clientId: "example-client",
    clientSecret: "example-client-secret",
    scopes: ["profile", "email", "read"],
    tokenEndpointAuthMethod: "client_secret_post",
  },
});

const auth = await api.startOAuth({ slug: "example-api" });
return auth.authorizationUrl;

OAuth connections run server-side in Backoffice. Use the token endpoint auth method configured for the provider's OAuth app registration. Confidential clients usually use tokenEndpointAuthMethod: "client_secret_post" or "client_secret_basic" with clientSecret. Public PKCE client registrations use tokenEndpointAuthMethod: "none" with client id and scopes.

OAuth restart and troubleshooting notes:

  • To restart OAuth with unchanged settings, call api.startOAuth({ slug }) and give the user the newest authorizationUrl.
  • To restart OAuth after auth settings were removed or the connection shows authMode: "none", recreate the connection with the full OAuth config and then call api.startOAuth({ slug }).
  • After changing tokenEndpointAuthMethod, client secret, scopes, endpoints, or redirect route, start OAuth again and tell the user to use the newest OAuth tab. Old authorization URLs contain old state, redirect URI, and PKCE challenge data.
  • If the callback reports The client cannot authenticate with methods: [...], the authorization step succeeded and the token exchange failed. Align the configured tokenEndpointAuthMethod with the provider-side OAuth app registration. Use "client_secret_post" or "client_secret_basic" for confidential client registrations, and use "none" for public PKCE client registrations.
  • If a previously failing client starts working after provider-side changes, recreate or update the connection and generate a fresh authorization URL before retesting.

API events

Cataloged automation events:

  • source: api, eventType: connection.changed — fires when an API connection is created or its configuration changes.
  • source: api, eventType: connection.deleted — fires when an API connection is deleted.
  • source: api, eventType: connection.available — fires when auth becomes usable after bearer setup, OAuth callback, or client-credentials token acquisition. Connection hook payloads include connectionId and a connection snapshot with slug, name, baseUrl, authMode, and status.

API tools

API tools can:

  • list configured API connections;
  • create and delete outbound HTTP API connections;
  • inspect auth status;
  • store bearer tokens;
  • start OAuth login;
  • delete stored auth;
  • execute authenticated HTTP requests through a configured connection.

Use codemode first. The api provider methods are listConnections, createConnection, deleteConnection, getAuthStatus, setToken, startOAuth, deleteAuth, and request.

Examples:

js
await api.listConnections();
await api.getAuthStatus({ slug: "example-api" });
await api.request({
  slug: "example-api",
  method: "GET",
  path: "/v1/resources",
  headers: { Accept: "application/json" },
  timeoutMs: 30_000,
});

For JSON request bodies, use api.request --json '{"key":"value"}'. For text bodies, use --body.

Request debugging notes:

  • Always check api.getAuthStatus({ slug }) before debugging an API request. authenticated: true means OAuth credentials are stored; returned HTTP 404, 405, or 500 statuses are upstream API responses.
  • Treat upstream 4xx and 5xx responses from api.request as response data with status, statusText, headers, and body.
  • If a user provides a full URL, convert it to a relative path for the configured connection base URL.
  • For endpoints like token introspection, inspect the upstream Allow and WWW-Authenticate headers. A 405 with Allow: OPTIONS, POST means retry with POST; a 401 invalid_client means that endpoint requires its own client authentication and often a form body such as a token parameter.
  • If you see a runtime validation error about missing statusText, rebuild or restart the API fragment/runtime; current API responses include statusText.

Domande frequenti

Cosa fa la skill IA Api Connection?

Configura e usa le connessioni API di Backoffice. Usalo per creare integrazioni API HTTP in uscita, configurare l’autenticazione OAuth o bearer, avviare flussi OAuth API, controllare lo stato dell’autenticazione o eseguire richieste API autenticate dalle automazioni.

Perché usare Api Connection su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Api Connection è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Api Connection in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/rejot-dev/fragno/tree/main/apps/backoffice/content/static/skills/api-connection. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Api Connection?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Api Connection?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Api Connection: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Api Connection è gratuita?

Sì. È pubblicata su GitHub da rejot-dev con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇