> This page is for version V3 - Beta (default).
> For other versions, use one of these documentation indexes:
> - V3 - Beta (default): https://docs.authlyx.dev/v3/llms.txt
> - V2 - Legacy: https://docs.authlyx.dev/v2/llms.txt
> - V1 - End of support: https://docs.authlyx.dev/v1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.authlyx.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.authlyx.dev/_mcp/server.

# Remote Scripts

> Publish signed text that your own app can fetch and interpret.

Suppose a desktop game lets its developer change a weekly challenge without shipping a new game build. The developer can publish a small Lua file in AuthlyX. The game fetches the text after sign-in, verifies the AuthlyX signature, then passes the text to its own Lua interpreter.

AuthlyX stores, signs and delivers the text. **AuthlyX does not run it.** The application decides whether the text is code, configuration or something else, and how to handle it.

```mermaid
%%{init: {"theme":"base","themeVariables":{"primaryColor":"#ffffff","primaryTextColor":"#171717","primaryBorderColor":"#404040","lineColor":"#606060","secondaryColor":"#f5f5f5","tertiaryColor":"#ffffff","edgeLabelBackground":"#ffffff"}}}%%
flowchart LR
  A[Developer writes challenge.lua] --> B[Publish revision in dashboard]
  B --> C[AuthlyX stores and signs that revision]
  D[Game signs in and fetches script] --> C
  C --> E[SDK verifies signature and app binding]
  E --> F[Game chooses to pass verified text to Lua]
```

## Publish and fetch a script

1. Open **App Data → Scripts** for the app and create a stable name such as `weekly_challenge`.
2. Save and review the text, then publish a revision.
3. In the signed-in app, call `getScript("weekly_challenge")`.
4. Use the returned text only after the SDK verifies the signed response.
5. Test the new revision with a test identity before releasing your app's update.

The SDK returns text. It does not know whether that text is Lua, JSON, a rules file or another format. Your app must parse it and decide what to do. A small example for a Lua-enabled game might look like:

```lua
return {
    challenge = "collect_10_items",
    reward = 250
}
```

Only a game that already includes a Lua interpreter and code to read these fields can use that example. A normal C# or C++ app will not run it automatically.

## Choose scripts when

* Your app already has a safe interpreter or parser for the content.
* You need to update a rules file or challenge text without replacing the whole application.
* You understand that customers can inspect anything delivered to their device.

Use Cloud Variables for simple shared values such as a maintenance message or download URL. Use a Script when the app needs a larger structured file or code text for an interpreter it already contains.

## Limit older revisions

Each publish creates a revision. You can require a minimum app version or minimum script revision, and withdraw a revision to stop new downloads of it. A customer may still have a copy they fetched earlier; withdrawal cannot erase it from their disk.

Before publishing a replacement, test it with the app versions that will fetch it. If a revision is broken, withdraw it and publish a fixed revision. Do not make your app depend on being able to retrieve an old revision forever.

## Keep signing keys trusted

The SDK verifies a script with public keys shipped in the SDK configuration. For a planned key rotation, release SDK configuration that trusts both the current and next public keys. Switch the server to the new private key only after customers have a version that trusts it. Keep the old public key during the transition, then remove it in a later SDK release.

Signatures prove who issued the text and whether it changed in transit. They do not make unsafe code safe, hide the text from customers or stop a customer from changing their own app. Never put passwords, private keys, payment decisions or server-only rules in a script.