extension-http-outcalls

HTTP outcalls performed by the backend canister (not in the frontend).

npx skills add https://github.com/caffeinelabs/skills --skill extension-http-outcalls

HTTP Outcalls

HTTP outcalls extension for Caffeine AI.

Overview

This skill adds the ability to make HTTP GET and POST requests from the backend canister. Useful for integrating with external APIs and services.

Backend

For HTTP outcalls that must be performed in the backend:

There is the prefabricated module mo:caffeineai-http-outcalls/outcall.mo that that cannot be modified. It provides fundamental functionality for making HTTP GET or PUT requests in the backend.

module {
  public type TransformationInput = {
    context : Blob;
    response : IC.HttpRequestResult;
  };
  public type TransformationOutput = IC.HttpRequestResult;
  public type Transform = query TransformationInput -> async TransformationOutput;
  public type Header = {
    name: Text;
    value: Text;
  };

  // Helper function for the transform callback used by the IC on HTTP outcalls.
  public func transform(input : TransformationInput) : TransformationOutput;

  // HTTP GET request with a transform callback function.
  public func httpGetRequest(url : Text, extraHeaders: [Header], transform : Transform) : async Text;

  // HTTP POST request, specifying a transform callback.
  public func httpPostRequest(url : Text, extraHeaders: [Header], body : Text, transform : Transform) : async Text;
};

Usage for GET:

import OutCall "mo:caffeineai-http-outcalls/outcall";

actor {
  public query func transform(input: OutCall.TransformationInput) : async OutCall.TransformationOutput {
    OutCall.transform(input);
  };

  func makeGetOutcall(url: Text) : async Text {
    await OutCall.httpGetRequest(url, [], transform);
  };
};

Hint: JSON parsing is not directly supported in Motoko. Better tunnel JSON to frontend for parsing.

POST usage is analogous.

Больше skills от caffeinelabs

extension-stripe
caffeinelabs
Поддержка платежей на основе Stripe, поддерживающая кредитные и дебетовые карты
extension-object-storage
caffeinelabs
Общее хранилище файлов/объектов, например для изображений, видео, файлов, документов и других объемных данных. Идеально подходит для галерей изображений, видеогалерей и других систем управления файлами или объектами. Поддерживает большие файлы, превышающие лимит IC, с доступом по HTTP-URL, кэшируемым браузером.
developmentmedia
extension-openai
caffeinelabs
MANDATORY recipe for every Caffeine build that calls OpenAI (ChatGPT, GPT-4o, an LLM, a chatbot, embeddings). The ONLY supported path is the `openai-client` mops package with a canister-side API-key bearer. Hand-rolling `ic.http_request` to `api.openai.com/v1/...` is a FORBIDDEN anti-pattern — it leaks the bearer across replicated outcalls (security + 13× billing impact), bypasses the typed request/response bindings, and forces hand-rolled JSON on a language with poor JSON support. Load this...
developmentapisecurity
connector-googlemail
caffeinelabs
Use the `googlemail-client` mops package whenever the user asks the canister to send email, compose a draft, list or read Gmail messages, or fetch the authenticated user's Gmail profile. The package wraps the Gmail REST API v1 at `https://gmail.googleapis.com` via outbound HTTPS calls.
communicationapiproductivity
extension-querying-oql
caffeinelabs
Quick reference for the Caffeine Data Intelligence agent to query an OQL-exposing canister (schema() + execute()) through the `icp` CLI against the project's `backend` canister: read the schema, form JSON queries (filter / order / paginate / aggregate / dotted-path edges), and parse the Candid result rows.
developmentdatabaseapi
extension-core-infrastructure
caffeinelabs
Базовая инфраструктура, предоставляющая конфигурацию серверного подключения, клиент хранилища и точку входа React-приложения.
developmentapidevops
extension-posting-to-x
caffeinelabs
MANDATORY recipe for every Caffeine build that posts to X (Twitter). The ONLY supported path is the `x-client` mops package with OAuth 2.0 PKCE. Hand-rolling `ic.http_request` or `icBooking.http_request` calls to `api.x.com/2/tweets`, `api.x.com/2/oauth2/token`, or any other X endpoint is a FORBIDDEN anti-pattern — it bypasses bearer auth, replication-cost safeguards, and `x-client`'s null-field handling. Load this skill whenever the user, spec, or any prior task mentions tweeting,...
developmentapi
extension-qr-code
caffeinelabs
QR code scanner using the camera.
productivitymediaimage