Delphi use cases: one job, one page

A product page tells you what a component does. A reference page tells you what every property is called. Neither of them tells you how to finish the job you sat down to finish. These pages do that. Each one takes a single task from an empty form to working code, names the unit and the component at every step, and says up front which product, which edition and which platforms it needs, so you know the cost before you write the first line.

One task per page, start to finish
Pascal from the shipping source
Edition and platform stated first
Delphi 7 to RAD Studio 13

What a use case page gives you

Every page on this list follows the same shape, because the questions are always the same three, asked in the same order.

A job, not a component

The page is organised around the outcome you want, so the components appear when the task reaches them. Where a job spans several components, all of them are here, in the order you would actually meet them. Where two routes exist, both are shown and the trade-off between them is spelled out.

Code you can paste

The Pascal comes from the shipping source and the demo projects in the box, not from pseudocode. Unit names are given in every uses clause, event handlers carry their real signatures, and the failure cases that cost an afternoon are called out where they happen rather than in a footnote.

What it costs before you start

Each page states the product, the edition, the compiler versions and the platforms the job needs, at the top. Half of these features are gated behind an {$IFDEF} in sgcVer.inc, so a method that will not resolve is a licence answer, not a syntax one, and it is better to know that on page one.

Pick the job you are doing

Each summary below is long enough to answer the question on its own, so you can decide whether the full page is worth your next twenty minutes before you open it.

Call an LLM from Delphi

Send a prompt from a VCL, FMX or console application and get an answer back, from a hosted model such as OpenAI or Anthropic Claude, or from a model running on your own machine through Ollama. There are two routes. TsgcAIChat puts every provider behind one API, so changing vendor is a single assignment to Provider, and the per-vendor clients TsgcHTTP_API_OpenAI, TsgcHTTP_API_Anthropic and TsgcHTTP_API_Ollama expose each vendor API in full when you need vision input, batches, embeddings or transcription.

The page then covers the three things every project hits next. Streaming, so text appears in the memo while the model is still writing, at both the decoded-delta level and the raw event level. Tool calling, where you describe a Pascal function as JSON Schema and the model asks you to run it. And the choice between a hosted model and a local one, which for anything covered by a data processing agreement is a compliance decision rather than a performance one.

Needs: sgcWebSockets Enterprise or the standalone sgcAI package. The REST clients compile on Windows, macOS, Linux, iOS and Android; TsgcAIChat is Windows only, so the page shows both routes.

Read the guide →

Sign a user in with OAuth2 and PKCE

The Authorization Code flow with PKCE, which is the flow every provider now expects from a native desktop application, driven by one non-visual component. No embedded browser, no web server of your own, no REST framework. TsgcHTTP_OAuth2_Client generates the verifier, derives the challenge, opens the system browser, listens on a loopback redirect, exchanges the code and fires OnAfterAccessToken with the token.

Where the flow goes wrong on the desktop is the redirect, so the page spends real time on it: why the redirect is a loopback address and not a public URL, what to register with the provider, and what redirect_uri_mismatch is telling you. It then covers refresh tokens, so the browser never opens a second time, storing a credential without leaving it lying around, the ready-made Google and Microsoft components, and the XOAUTH2 hand-off that Gmail and Microsoft 365 now require over SMTP and IMAP.

Needs: sgcWebSockets Standard and above, or the standalone sgcAuth package. Windows, macOS, Linux, iOS and Android. Only the authorization server half is an Enterprise feature.

Read the guide →

Connect two Delphi applications with WebRTC

Two applications on two different networks, exchanging a chat channel, a microphone stream and a camera stream directly between each other, with no media server in the middle and no browser embedded in the process. The page splits WebRTC into the four problems it actually is: describing the session as an SDP offer and answer, carrying that description to the other side, finding a path through the NATs, and moving the bytes.

Signalling is the part you write yourself, so it is here in full as a dumb relay over TsgcWebSocketServer with three message kinds. Then the peer connection and its events, ICE candidates and what host, server reflexive and relay candidates each cost you, the TURN switch people forget, SCTP data channels with per-channel reliability, and audio and video tracks, which are a different transport with different failure modes from a data channel. It closes on the failures that produce no error at all, which is what makes peer to peer hard to debug.

Needs: the peer connection, ICE and TURN clients come with sgcWebSockets Enterprise. The offer and answer methods, data channels and media tracks need the sgcWebRTC pack on top of Enterprise, which is also included in All-Access. A STUN client arrives with Standard.

Read the guide →

More jobs are being written up. If the one you are doing is not here yet, the blog covers a great deal of the same ground article by article, and support will point you at the right demo project in the meantime.

Product, edition and platform at a glance

The same information each page states in its opening section, gathered so you can compare the cost of three jobs without opening three tabs.

Guide Main components Product and edition Platforms
Call an LLM from Delphi TsgcAIChat, TsgcHTTP_API_OpenAI, TsgcHTTP_API_Anthropic, TsgcHTTP_API_Ollama sgcWebSockets Enterprise, or the standalone sgcAI package REST clients on Windows, macOS, Linux, iOS and Android. TsgcAIChat on Windows.
OAuth2 login with PKCE TsgcHTTP_OAuth2_Client, and the Google and Microsoft wrappers sgcWebSockets Standard and above, or the standalone sgcAuth package Windows, macOS, Linux, iOS and Android
WebRTC between two applications TsgcRTCPeerConnection, TsgcICEClient, TsgcTURNClient, TsgcWebSocketServer sgcWebSockets Enterprise for the peer connection, plus the sgcWebRTC pack for offer and answer, data channels and media. Both are in All-Access. Windows for capture and render. The transport itself is cross-platform.

Every edition claim above is the one the shipping sgcVer.inc enforces. The full breakdown is on the Delphi feature matrix, and the which edition page walks the same decision from the other direction.

If a task guide is not what you wanted

These pages answer the neighbouring questions: what a component does, what it is called, how it compares, and what it costs.

sgcWebSockets The library behind every guide on this page, from WebSocket and HTTP/2 to MQTT, AMQP, WebRTC and the AI clients.
Library comparison Still choosing a library rather than writing code? The comparison hub puts sgcWebSockets next to Indy, ICS, TMS, mORMot 2, IPWorks and Chilkat.
Component reference Every component in the library, with the properties, methods and events each one publishes, and a technical document behind it.
Glossary The protocol, cryptography and authentication terms these guides use, each linked to the RFC that defines it.
Blog Several hundred worked articles, including the release posts each of these guides draws on.
Editions and pricing What Standard, Professional, Enterprise and All-Access each include, and where the standalone packs fit.
3,000+Developers
20+Years
761+Components
30+API Integrations
5Platforms
30-Day Money-Back GuaranteeNot satisfied? Request a full refund within 30 days of purchase. See refund policy

Every guide starts with the same download

The trial is the whole library with every component enabled, and the demo projects each guide refers to ship inside it.