Update README.md
This commit is contained in:
@@ -9,26 +9,24 @@ Previously, there was a "deploy to cloudflare" button here, but it seems to only
|
||||
|
||||
### Docker
|
||||
|
||||
This worker requires that the KV store is pre-populated with client-id keys and client-secret values, but doesn't provide any mechanism for this to work with selflare. As such, the docker container may not be usable until this is resolved. PRs are welcome.
|
||||
|
||||
This worker is also availible as a docker container at [ghcr.io/sugoidogo/twitch-cloud-ebs](https://github.com/sugoidogo/twitch-clips-consent-api/pkgs/container/twitch-clips-consent-api).
|
||||
It listens on HTTP port 8080 and requires mounts for `/worker/cache`, `/worker/kv`, `/worker/d1`, and `/worker/r2`.
|
||||
The r2 and kv mounts are the only ones actually used, but the selflare runtime requires all of them regardless.
|
||||
Previously, this repo produced oci images, but they were inclomlete and more work is needed before they are ready.
|
||||
|
||||
## Twurple Module
|
||||
|
||||
https://gitea.sugoidogo.com/sugoidogo/-/packages/npm/@sugoidogo%2Ftwitch-cloud-ebs/
|
||||
|
||||
This API provides two Twurple modules, one for authorization and one for storage, allowing for easy integration if you're already using the Twurple javascript library.
|
||||
the WebStorage module can be used to cache fetched resources from anywhere, but when used as demonstrated below, allows your client to maintain access to previously stored resources from cloud storage via the browser's CacheStorage API.
|
||||
|
||||
<details><summary>javascript</summary>
|
||||
|
||||
```javascript
|
||||
import SugoiAuthProvider from 'https://ebs.domain.com/SugoiAuthProvider.js'
|
||||
import WebStorage from 'https://ebs.domain.com/WebStorage.js'
|
||||
import { ApiClient } from 'https://cdn.jsdelivr.net/npm/@twurple/api@7/+esm';
|
||||
import { SugoiAuthProvider, WebStorage } from '@sugoidogo/twitch-cloud-ebs'
|
||||
import { ApiClient } from '@twurple/ebs';
|
||||
|
||||
const authProvicder=new SugoiAuthProvider('your-client-id')
|
||||
const webStorage=new WebStorage(authProvider)
|
||||
const ebs_host='https://your.ebs.hostname'
|
||||
const authProvicder=new SugoiAuthProvider('your-client-id',ebs_host)
|
||||
const webStorage=new WebStorage(authProvider,undefined,ebs_host)
|
||||
const apiClient = new ApiClient({ authProvider });
|
||||
|
||||
const config=await webStorage.fetch('config.json').then(response=>response.json())
|
||||
|
||||
Reference in New Issue
Block a user