Add configure() function
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# threads-client
|
||||
# threads-luau
|
||||
|
||||
A Roblox server-side client for the [Threads](https://github.com/filoxen/threads) service. Handles reuploading clothing assets through your Threads instance.
|
||||
|
||||
@@ -8,7 +8,7 @@ Add to your `wally.toml` dependencies:
|
||||
|
||||
```toml
|
||||
[server-dependencies]
|
||||
ThreadsClient = "secret-rare/threads-luau@0.2.0"
|
||||
ThreadsClient = "secret-rare/threads-luau@0.3.0"
|
||||
```
|
||||
|
||||
Then run:
|
||||
@@ -19,15 +19,20 @@ wally install
|
||||
|
||||
## Setup
|
||||
|
||||
1. Add your API key to the **Secrets Store** in the Creator Dashboard with the name `THREADS_API_KEY` (or your own custom secret name).
|
||||
1. Host your own [Threads](https://github.com/filoxen/threads) instance.
|
||||
|
||||
2. Update `BASE_URL` in the module to point to your Threads API instance.
|
||||
2. Add your API key to the **Secrets Store** in the Creator Dashboard with the name `THREADS_API_KEY` (or a custom name).
|
||||
|
||||
## Usage
|
||||
|
||||
```luau
|
||||
local ThreadsClient = require(path.to.ThreadsClient)
|
||||
|
||||
ThreadsClient.configure({
|
||||
baseUrl = "https://your-threads-instance.com",
|
||||
apiKeySecretName = "THREADS_API_KEY", -- optional, this is the default
|
||||
})
|
||||
|
||||
local newAssetId = ThreadsClient.create(assetId)
|
||||
|
||||
if newAssetId ~= -1 then
|
||||
|
||||
Reference in New Issue
Block a user