external-api-workflows
Skill646 starsChanged 55 days agoMITView on GitHub
Build a Universal App workflow that calls a third-party API or custom model endpoint through a server-side function. Use for API keys, webhooks, Azure OpenAI-compatible endpoints, payment, messaging, or any provider credential that must stay out of the browser.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- microsoft/ignite26-PREL40word for word, first seen Nov 22, 2026
Other versions1 project uses a version of this.
Word for word · 1
- microsoft/ignite26-PREL40★ 3100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository76 other files it gives its agents.
- common/config/typedoc/AGENTS.mdAGENTS.md
- docs/site/AGENTS.mdAGENTS.md
- .github/skills/react-best-practices/AGENTS.mdAGENTS.md
- packages/docgen/AGENTS.mdAGENTS.md
- packages/guide/AGENTS.mdAGENTS.md
- packages/host-docs/AGENTS.mdAGENTS.md
- packages/tools/AGENTS.mdAGENTS.md
- packages/tools/cli/AGENTS.mdAGENTS.md
- packages/tools/cli/assets/agent-files/AGENTS.mdAGENTS.md
- packages/tools/common/AGENTS.mdAGENTS.md
- packages/tools/docs-lib/AGENTS.mdAGENTS.md
- packages/tools/mcp/AGENTS.mdAGENTS.md
- packages/tools/vscode/AGENTS.mdAGENTS.md
- packages/typescript-sdk/AGENTS.mdAGENTS.md
- packages/typescript-sdk/auth/AGENTS.mdAGENTS.md
- packages/typescript-sdk/core/AGENTS.mdAGENTS.md
- packages/typescript-sdk/data/AGENTS.mdAGENTS.md
- packages/typescript-sdk/storage/AGENTS.mdAGENTS.md
- packages/udf/udf-worker-extension/AGENTS.mdAGENTS.md
- samples/data-app/AGENTS.mdAGENTS.md
- samples/getting-started-auth/AGENTS.mdAGENTS.md
- samples/notes-app/AGENTS.mdAGENTS.md
- samples/todo-app/AGENTS.mdAGENTS.md
- samples/universal-app/template/AGENTS.mdAGENTS.md
- samples/welcome-app-react-auth/AGENTS.mdAGENTS.md
- samples/welcome-app-react-no-auth/AGENTS.mdAGENTS.md
- samples/welcome-app-typescript/AGENTS.mdAGENTS.md
- hotfix-releaseSkill
- launch-vscode-extensionSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-bulk-archive-changeSkill
- openspec-continue-changeSkill
- openspec-exploreSkill
- openspec-ff-changeSkill
- openspec-new-changeSkill
- openspec-onboardSkill
- openspec-sync-specsSkill
- openspec-verify-changeSkill
- privacy-dfdSkill
- rayfin-cli-uxSkill
- vercel-react-best-practicesSkill
- react-clean-architectureSkill
- run-cli-e2e-locallySkill
- vscode-react-webview-architectureSkill
- vscode-webview-trpc-messagingSkill
- rayfin-connectorsSkill
- rayfin-functionsSkill
- rayfinSkill
- rayfin-storageSkill
- rayfin-getting-startedSkill
- app-designSkill
- app-validationSkill
- dax-authoringSkill
- fabric-cliSkill
- fabric-sdkSkill
- playwright-cliSkill
- query-designSkill
- schema-discoverySkill
- visualsSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. About 0 are common, 16 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Use a Rayfin function as the trust boundary between the UI and the external provider.
- Very specific: line 14
Read functions-capability and apply its pack before implementing this workflow.
- Distinctive: line 21
Never put the value in YAML:
- Very specific: line 31
Read app-deployment and complete its version-matched Rayfin CLI workflow.
- Distinctive: line 41
If the host can spawn an independent interactive terminal, open it at the app root and start this command there so the masked prompt is …
- Distinctive: line 43
Do not claim that a terminal was opened unless the launch succeeded.
- Distinctive: line 45
Do not pass the value through a non-interactive shell tool.
- Distinctive: line 47
Do not ask the user to paste a secret into chat.
- Distinctive: line 48
Do not place the value in source, YAML, frontend environment variables, command arguments, logs, or function output.
- Distinctive: line 50
Wait for the user to confirm that provisioning completed before invoking the deployed workflow.
- Very specific: line 53
After the value is provisioned, open the deployed fabricUrl and have the user invoke the workflow in the authenticated UI.
- Distinctive: line 56
Do not report the workflow complete before this deployed invocation succeeds unless the user explicitly defers runtime validation.
- Very specific: line 86
Never hard-code the secret name anywhere else — it comes from rayfin.yml via the generated registry.
- Very specific: line 91
Do not return apiKey, compare it against browser input, or include it in an exception.
- Distinctive: line 98
Do not call generic cloud or provider best-practices tools for a provider-neutral request.
- Distinctive: line 104
Treat non-success provider responses as expected domain outcomes when the UI can act on them.
- Distinctive: line 106
Do not return raw provider bodies or stack traces.
- Distinctive: line 108
Do not log the request body, response body, authorization header, secret, prompt, or user content.
- Distinctive: line 111
Use a bounded result rather than exposing provider data directly:
- Distinctive: line 136
Keep an unexpected-failure state for failures outside the known domain result.
- Distinctive: line 138
If the provider can take longer than the browser client's configured deadline, do not increase the global timeout for unrelated app …
- Distinctive: line 140
Use a dedicated client only as a documented temporary workaround until the SDK supports a per-invocation timeout.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
External API workflows
Use a Rayfin function as the trust boundary between the UI and the external
provider.
Read functions-capability and apply its pack before implementing this
workflow.
Secret contract
Declare only the secret name and a non-sensitive description in
rayfin/rayfin.yml.
Never put the value in YAML:
secrets:
- name: THIRD_PARTY_API_KEY
description: Credential used by the server-side fulfillment request.Deploy the app once before provisioning the value. Obtain the user's
confirmation for the target workspace and remote deployment.
Read app-deployment and complete its version-matched Rayfin CLI workflow.
The current secret command requires a deployed AppBackend endpoint.
Then ask the user to run:
npx rayfin secret set THIRD_PARTY_API_KEYThis command requires an interactive terminal for its masked prompt. If the host can spawn an independent interactive terminal, open it at the app root and start this command there so the masked prompt is immediately waiting. Do not claim that a terminal was opened unless the launch succeeded. Otherwise, pause and tell the user where to run the exact command. Do not pass the value through a non-interactive shell tool. The user enters the value directly into that command's masked prompt. Do not ask the user to paste a secret into chat. Do not place the value in source, YAML, frontend environment variables, command arguments, logs, or function output. Wait for the user to confirm that provisioning completed before invoking the deployed workflow.
After the value is provisioned, open the deployed fabricUrl and have the user
invoke the workflow in the authenticated UI.
Confirm that the UI receives only the bounded result contract.
Do not report the workflow complete before this deployed invocation succeeds
unless the user explicitly defers runtime validation.
Retrieve the production value only inside the function. The secret is declared
with rayfin secret set, so it is typed — read it as a property:
const apiKey: string = ctx.Secrets.THIRD_PARTY_API_KEY;ctx.Secrets.<NAME> is typed string, not string | undefined: declaring the
secret is what makes it expected, and a name that was never declared is a
compile error. If the value was not supplied at invoke time the read throws a
diagnosable error rather than silently yielding undefined, so no
SECRET_NOT_CONFIGURED branch is needed. Catch it at the function boundary if
you want to map it onto the bounded result contract:
try {
const apiKey: string = ctx.Secrets.THIRD_PARTY_API_KEY;
// ...call the external service...
} catch {
return {
ok: false,
code: 'SECRET_NOT_CONFIGURED',
message: 'The external service credential is not configured.',
};
}Never hard-code the secret name anywhere else — it comes from rayfin.yml via
the generated registry. ctx.getSecret('NAME') is deprecated and flagged by
@typescript-eslint/no-deprecated; it remains valid only for a value
deliberately not modelled in rayfin.yml.
Do not return apiKey, compare it against browser input, or include it in an
exception.
An environment fallback may be used only for local debugging through the
functions project's ignored local settings.
Provider boundary
- Do not call generic cloud or provider best-practices tools for a provider-neutral request. Use a provider-specific tool only after the user identifies that provider and the tool is needed to establish its contract.
- Validate and bound every browser-supplied value before making a request.
- Set an explicit outbound deadline appropriate for the provider.
- Send only required headers and fields.
- Treat non-success provider responses as expected domain outcomes when the UI can act on them.
- Do not return raw provider bodies or stack traces.
- Select and bound the provider fields returned to the browser.
- Do not log the request body, response body, authorization header, secret, prompt, or user content.
Use a bounded result rather than exposing provider data directly:
type ExternalCallResult =
| { ok: true; value: string }
| {
ok: false;
code:
| 'SECRET_NOT_CONFIGURED'
| 'AUTHENTICATION_FAILED'
| 'PROVIDER_REJECTED'
| 'PROVIDER_TIMEOUT';
message: string;
};Expected provider failures use the safe result. Unexpected failures may still throw, but the thrown message must not contain a secret, request body, raw provider response, or sensitive exception detail.
UI contract
Show an in-progress state for the complete invocation. Render safe, actionable outcomes for missing configuration, invalid authentication, provider rejection, and timeout. Keep an unexpected-failure state for failures outside the known domain result.
If the provider can take longer than the browser client's configured deadline, do not increase the global timeout for unrelated app operations. Use a dedicated client only as a documented temporary workaround until the SDK supports a per-invocation timeout.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

