# platformServiceSettings

You can use this to hook Stream Avatars up to any service you want.

{% hint style="warning" %}
It is not possible to allow the extension to work with a custom platform service.
{% endhint %}

```lua
function output(string_message)
    log('the app wants to send a message to your viewers...');
    log(string_message);
end

return function()

    local app = getApp();

    addEvent('luaPlatformOutput', 'output'); --attaches the event to output()

    local myUserId = 1234;
    local myUserName = 'clonzeh_lua';

    app.platformServiceSettings.SetStreamer(myUserId, myUserName);
    wait(3);
    app.platformServiceSettings.SetUserJoin(myUserId, myUserName);
    wait(3);
    app.platformServiceSettings.AddMessage(myUserId, myUserName, 'hello test');
    wait(3);
    app.platformServiceSettings.AddMessage(myUserId, myUserName, '!mass jump');
    wait(3);
    app.platformServiceSettings.AddMessage(myUserId, myUserName, '!currency');
    wait(3);
    app.platformServiceSettings.SetFollower(myUserId, true);
    app.platformServiceSettings.SetSubscriber(myUserId, true);
    app.platformServiceSettings.SetModerator(myUserId, true);
    wait(1);
    
    app.platformServiceSettings.PlatformCurrencyDonation(myUserId, myUserName, 50, 1000); 
    --they donated 50, the lifetime total is now 1000

    app.platformServiceSettings.CustomCommandRedemption(myUserId, myUserName, 'Redemption Title Here',
        'extra user input here');
    wait(1);
    app.platformServiceSettings.SetUserLeave(myUserId);
    keepAlive();
end
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.streamavatars.com/lua-scripting-api/api-reference-and-tips/classes/app/platformservicesettings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
